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'))
def book_evaluate(book_id): db = DBOpera() if request.method == 'GET': if db.check_evaluate(book_id): return redirect(url_for('bookshelf')) else: return render_template('user_evaluate.html') if request.method == 'POST': scort = request.form['scort'] message = request.form['message'] db.add_evaluate(book_id, scort, message) db.update_integral(current_user.id, 5) return redirect(url_for('book_list'))
def activity_confirm(): ''' 验证入场码 ''' db = DBOpera() if request.method == 'GET': return render_template('manage_activityconfirm.html') if request.method == 'POST': postcode = request.form['postcode'] user_id = db.ticket_check(postcode) if user_id: db.update_integral(user_id, 50) pass #TODO(CAOYUE):验证成功,需要加成功提示在前端 else: pass #TODO(CAOYUE):验证失败,需要加失败提示在前端 return redirect(url_for('activity_confirm'))