|
|
@@ -491,13 +491,13 @@
|
|
|
) scale_wx_virtual on p.company_id = scale_wx_virtual.company_id
|
|
|
left join (select company_id, scale, ifnull(commission_scale, 1) as commission_scale from thirtpart.ly_responsibility_person_scale where source=1
|
|
|
and #{st} >= start_time and #{st} <= end_time
|
|
|
- ) scale_wx_common on p.company_id = scale_wx_virtual.company_id
|
|
|
+ ) scale_wx_common on p.company_id = scale_wx_common.company_id
|
|
|
left join (select company_id, scale, ifnull(commission_scale, 1) as commission_scale from thirtpart.ly_responsibility_person_scale where source=2
|
|
|
and #{st} >= start_time and #{st} <= end_time
|
|
|
) scale_tt_common on p.company_id = scale_tt_common.company_id
|
|
|
left join (select company_id, scale from thirtpart.ly_responsibility_person_scale where source=12
|
|
|
and #{st} >= start_time and #{st} <= end_time
|
|
|
- ) scale_wx_ad_amount on p.company_id = scale_wx_virtual.company_id
|
|
|
+ ) scale_wx_ad_amount on p.company_id = scale_wx_ad_amount.company_id
|
|
|
<!-- where p.is_distributor = 1 or p.pid in (select id from thirtpart.ly_responsibility_person where is_distributor=1)-->
|
|
|
group by 1,2,3,4,5,6,7,8,9,10,11,12
|
|
|
) t2 on t1.link_id = t2.link_id
|
|
|
@@ -516,7 +516,7 @@
|
|
|
and status = 1
|
|
|
group by 1,2,3
|
|
|
)t4 on t1.stat_date = t4.refund_date and t1.link_id = t4.link_id and t1.pay_merchant=t4.pay_merchant
|
|
|
- group by consume_date, t2.person_id) tb
|
|
|
+ group by consume_date, t2.person_id, t2.link_id) tb
|
|
|
|
|
|
</insert>
|
|
|
<select id="runCPSIaaDySettlementData" resultType="com.alibaba.fastjson.JSONObject">
|