Esempio n. 1
0
def order_confirm(order_id):
    '''
    管理员,确认订单
    '''
    if request.method == 'GET':
        db = DBOpera()
        db.update_order_status(order_id)
        num = db.get_orderPrice(order_id)
        user_id = db.get_orderUser(order_id)
        num = int(num)
        db.update_integral(user_id, num)
        return redirect(url_for('order_list'))
Esempio n. 2
0
def order_detail(order_id):
    '''用户订单详情'''
    db = DBOpera()
    if request.method == 'GET':
        books = db.get_orderAttach(order_id)
        list = []
        for cart in books:
            dict = {}
            dict["book_id"] = int(cart[0].book_id)
            dict["book_name"] = cart[0].book_name
            dict["book_price"] = cart[0].book_price
            if cart[0].book_image:
                dict["book_image"] = 'files/' + str(
                    dict["book_id"]) + '/' + cart[0].book_image
            else:
                dict["book_image"] = ''
            dict["book_num"] = int(cart[1])
            list.append(dict)
        price = db.get_orderPrice(order_id)
        return render_template('user_orderAttach.html',
                               book_list=list,
                               price=price,
                               order_id=order_id)