|
@@ -23,7 +23,13 @@ def insert_order_data(ymd):
|
|
|
DATE_FORMAT(FROM_UNIXTIME(f.create_time), '%Y-%m-%d %H:%i:%s') as reg_time,
|
|
|
a.amount ,ifnull(d.name,''),a.order_id ,a.status
|
|
|
from db_mp.h_pay a
|
|
|
- left join db_mp.mp_conf_agent b on a.app_id =b.app_id and a.agent_id =b.agent_id
|
|
|
+ left join
|
|
|
+ (select b.agent_id,b.advertiser_conf_id from
|
|
|
+ (select agent_id,max(update_time) as update_time
|
|
|
+ from db_mp.mp_conf_agent mmc
|
|
|
+ group by agent_id ) a
|
|
|
+ left join db_mp.mp_conf_agent b on a.agent_id=b.agent_id
|
|
|
+ and a.update_time = b.update_time ) b on a.agent_id =b.agent_id
|
|
|
left join db_mp.mp_mp_conf c on b.advertiser_conf_id = c.id
|
|
|
left join db_mp.h_game d on a.app_id =d.id
|
|
|
left join db_mp.h_member f on a.mem_id = f.id
|