|
@@ -222,27 +222,14 @@
|
|
FROM (
|
|
FROM (
|
|
SELECT SUM(charge) as 'totalCharge'
|
|
SELECT SUM(charge) as 'totalCharge'
|
|
FROM application.kuaishou_operation_performance_base
|
|
FROM application.kuaishou_operation_performance_base
|
|
- WHERE account_id IN (
|
|
|
|
- SELECT account_id
|
|
|
|
- FROM ctop_user_allocation
|
|
|
|
- WHERE user_id IN (SELECT user_id
|
|
|
|
- FROM `application`.app_user_manage
|
|
|
|
- WHERE manage_id = #{userId})
|
|
|
|
- )
|
|
|
|
|
|
+ WHERE leader_id = #{userId}
|
|
AND stat_date >= #{startDate}
|
|
AND stat_date >= #{startDate}
|
|
AND stat_date <= #{endDate}
|
|
AND stat_date <= #{endDate}
|
|
) t1
|
|
) t1
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT SUM(contract_rebate_real_charged_in_yuan) as 'KFCharge', SUM(direct_rebate_real_charged_in_yuan) as 'JLCharge'
|
|
SELECT SUM(contract_rebate_real_charged_in_yuan) as 'KFCharge', SUM(direct_rebate_real_charged_in_yuan) as 'JLCharge'
|
|
-
|
|
|
|
FROM application.kuaishou_operation_performance_back_charge_base
|
|
FROM application.kuaishou_operation_performance_back_charge_base
|
|
- WHERE account_id IN (
|
|
|
|
- SELECT account_id
|
|
|
|
- FROM ctop_user_allocation
|
|
|
|
- WHERE user_id IN (SELECT user_id
|
|
|
|
- FROM `application`.app_user_manage
|
|
|
|
- WHERE manage_id = #{userId})
|
|
|
|
- )
|
|
|
|
|
|
+ WHERE leader_id = #{userId}
|
|
AND stat_date >= #{startDate}
|
|
AND stat_date >= #{startDate}
|
|
AND stat_date <= #{endDate}
|
|
AND stat_date <= #{endDate}
|
|
) t2 ON 1 = 1
|
|
) t2 ON 1 = 1
|