Commit 4ce66559 authored by xianyang's avatar xianyang

优化转账列表转入查询

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