Commit 4ce66559 authored by xianyang's avatar xianyang

优化转账列表转入查询

parent 58647224
...@@ -156,13 +156,16 @@ def accout_list_data(**params): ...@@ -156,13 +156,16 @@ def accout_list_data(**params):
if params.get("transfer_name"): if params.get("transfer_name"):
fi_sql = f"select uuid from fi_account where name='{params.get('transfer_name')}'" fi_sql = f"select uuid from fi_account where name='{params.get('transfer_name')}'"
fi_res = LinkMysql(env.DB_3YV2).query_mysql(fi_sql) u_sql = f"select uuid from v2_user where nick_name='{params.get('transfer_name')}'"
if fi_res: with ThreadPoolExecutor(max_workers=2) as pool:
transfer_uuid = fi_res[0]['uuid'] future1 = pool.submit(LinkMysql(env.DB_3YV2).query_mysql, fi_sql)
future2 = pool.submit(LinkMysql(env.DB_3YV2).query_mysql, u_sql)
fi_data = future1.result()
u_data = future2.result()
if fi_data:
transfer_uuid = fi_data[0]['uuid']
else: else:
u_sql = f"select uuid from v2_user where nick_name='{params.get('transfer_name')}'" transfer_uuid = u_data[0]['uuid'] if u_data else ''
u_res = LinkMysql(env.DB_3YV2).query_mysql(u_sql)
transfer_uuid = u_res[0]['uuid'] if u_res else ''
accout_filters.append(f" transfer_uuid='{transfer_uuid}'") accout_filters.append(f" transfer_uuid='{transfer_uuid}'")
if params.get("dst_name"): if params.get("dst_name"):
accout_filters.append(f" dst_name like '%{params.get('dst_name')}%'") accout_filters.append(f" dst_name like '%{params.get('dst_name')}%'")
......
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