Commit 50ab388c authored by pengxiong's avatar pengxiong

查询

parent 362af992
......@@ -110,7 +110,7 @@ class TAMP_SQL(object):
except:
try:
self.session.rollback()
except:
except:
pass
finally:
self.session.close()
......@@ -44,7 +44,7 @@ class TopUpOrderService:
and_(OrderFlow.createby == user_id, OrderFlow.ab_type == '6', OrderFlow.ab_status == 'SUCCESS')).count()
res = tamp_user_session.query(OrderFlow).filter(and_(OrderFlow.createby == user_id, OrderFlow.ab_type == '6', OrderFlow.ab_status == 'SUCCESS')).order_by(
OrderFlow.createtime.desc()).offset(offset).limit(pageSize)
res = [r.to_dict() for r in res]
res = [r.to_dict() for r in res]
allowed = {'id', 'ab_ordernum', 'transaction_serial_no', 'ab_payment', 'ab_pay_mode', 'createtime', 'pay_time', 'complete_time', 'ab_type'}
for r in res:
keys = set(r.keys()) - allowed
......@@ -142,10 +142,10 @@ class CurriculumOrderService:
res = tamp_user_session.query(OrderFlow).filter(
and_(OrderFlow.createby == user_id, OrderFlow.ab_type != '6', OrderFlow.ab_status == 'SUCCESS')
).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()) if r[4] else 0} for r in zhibo}
orders = [r.to_dict() for r in res if r.to_dict()['ab_status'] == 'SUCCESS']
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()) 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:
prod_type = order.get('ab_type', '')
......
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