Commit 87b8ce80 authored by pengxiong's avatar pengxiong

微信公众号支付

parent f54099dc
......@@ -144,7 +144,7 @@ class CurriculumOrderService:
).order_by(OrderFlow.createtime.desc()).offset(offset).limit(pageSize)
curriculum_column = {r[0]: {'title': r[1], 'cover': r[2], 'info': r[3]} for r in curriculum_column}
curriculum_res = {r[0]: {'title': r[1], 'cover': r[2], 'info': r[3]} for r in curriculum_res}
zhibo = {r[0]: {'title': r[1], 'cover': r[2], 'info': r[3], 'zb_start_time': int(r[4].timestamp())} for r in zhibo}
zhibo = {r[0]: {'title': r[1], 'cover': r[2], 'info': r[3], 'zb_start_time': int(r[4].timestamp()) if r[4] else 0} for r in zhibo}
orders = [r.to_dict() for r in res if r.to_dict()['ab_status'] == 'SUCCESS']
temp_orders = []
for order in orders:
......@@ -236,7 +236,7 @@ class CurriculumOrderService:
total_amount = args['ab_payment'] / 100
res = prePay(subject, out_trade_no, total_amount, notify_url)
pay_params = res
elif args['openid'] == 8:
elif args['ab_pay_mode'] == 8:
# 微信公众号支付
wx_pay = wx_jsapi_pay.WXPay(args['openid'], out_trade_no, subject, args['ab_payment'], args['remote_addr'], notify_url)
params = wx_pay.getReturnParams()
......@@ -385,7 +385,7 @@ def getAllOrders(args):
).order_by(OrderFlow.createtime.desc()).offset(offset).limit(pageSize)
curriculum_column = {r[0]: {'title': r[1], 'cover': r[2], 'info': r[3]} for r in curriculum_column}
curriculum_res = {r[0]: {'title': r[1], 'cover': r[2], 'info': r[3]} for r in curriculum_res}
zhibo = {r[0]: {'title': r[1], 'cover': r[2], 'info': r[3], 'zb_start_time': int(r[4].timestamp())} for r in zhibo}
zhibo = {r[0]: {'title': r[1], 'cover': r[2], 'info': r[3], 'zb_start_time': int(r[4].timestamp()) if r[4] else 0} for r in zhibo}
orders = [r.to_dict() for r in res if r.to_dict()['ab_status'] == 'SUCCESS']
temp_orders = []
for order in orders:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment