Commit 0ddfbc55 authored by xianyang's avatar xianyang

盲盒查询优化

parent f45ecd52
......@@ -629,6 +629,7 @@ class BlindBoxRecharge(object):
eny_month = self.time_month(end_month)
time_list = [start_month, eny_month]
time_list = list(set(time_list))
Logger().logger.info(f"开始查询数据!!!!日期:{time_list}")
if len(time_list) == 1:
data_sql = f"SELECT dst_uuid as uuid,amount,FROM_UNIXTIME(create_time) as create_time,reference_type,reference_number,reference_info FROM order_log_{time_list[0]} where {' and '.join(conditions)} ORDER BY create_time desc limit {(int(self.page) - 1) * self.size},{self.size}"
money_sql = f"SELECT sum(amount) as m_sum FROM order_log_{time_list[0]} where {' and '.join(conditions)}"
......@@ -644,6 +645,7 @@ class BlindBoxRecharge(object):
res_data = future1.result()
res_money = future2.result()
res_count = future3.result()
Logger().logger.info("查询数据over!!!!")
res_data_to = self._recharge_data(res_data)
if res_data_to:
return res_data_to, res_money[0].get('m_sum'), res_count[0].get('c_sum')
......
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