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)}"
count_sql=f"SELECT count(id) as c_sum FROM order_log_{time_list[0]} where {' and '.join(conditions)}"
data_sql=f"SELECT uuid,amount,FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number,channel,business_number FROM recharge_log_{time_list[0]} where {' and '.join(conditions)} ORDER BY payment_time desc limit {(int(self.page) - 1) * self.size},{self.size}"
money_sql=f"SELECT sum(amount) as m_sum FROM recharge_log_{time_list[0]} where {' and '.join(conditions)}"
count_sql=f"SELECT count(id) as c_sum FROM recharge_log_{time_list[0]} where {' and '.join(conditions)}"
else:
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)} UNION ALL SELECT dst_uuid as uuid,amount,FROM_UNIXTIME(create_time) as create_time,reference_type,reference_number,reference_info FROM order_log_{time_list[1]} where {' and '.join(conditions)} ORDER BY create_time desc limit {(self.page - 1) * self.size},{self.size}"
money_sql=f"SELECT sum(a.b) as m_sum FROM ("f"SELECT sum(amount) as b FROM order_log_{int(time_list[0])} where {' and '.join(conditions)} UNION ALL SELECT sum(amount)FROM order_log_{int(time_list[1])} where {' and '.join(conditions)}) AS a "
count_sql="SELECT sum(a.b) as c_sum FROM ("f"SELECT count(id) as b FROM order_log_{int(time_list[0])} where {' and '.join(conditions)} UNION ALL SELECT count(id) FROM order_log_{int(time_list[1])} where {' and '.join(conditions)}) AS a "
data_sql=f"SELECT uuid,amount,FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number,channel,business_number FROM recharge_log_{time_list[0]} where {' and '.join(conditions)} UNION ALL SELECT uuid,amount,FROM_UNIXTIME(create_time) as payment_time,reference_type,reference_number,channel,business_number FROM recharge_log_{time_list[1]} where {' and '.join(conditions)} ORDER BY payment_time desc limit {(self.page - 1) * self.size},{self.size}"
money_sql=f"SELECT sum(a.b) as m_sum FROM ("f"SELECT sum(amount) as b FROM recharge_log_{int(time_list[0])} where {' and '.join(conditions)} UNION ALL SELECT sum(amount)FROM recharge_log_{int(time_list[1])} where {' and '.join(conditions)}) AS a "
count_sql="SELECT sum(a.b) as c_sum FROM ("f"SELECT count(id) as b FROM recharge_log_{int(time_list[0])} where {' and '.join(conditions)} UNION ALL SELECT count(id) FROM recharge_log_{int(time_list[1])} where {' and '.join(conditions)}) AS a "