|
@@ -285,13 +285,13 @@
|
|
AND media_id =2
|
|
AND media_id =2
|
|
GROUP BY user_id) t) as 'totle'
|
|
GROUP BY user_id) t) as 'totle'
|
|
FROM (
|
|
FROM (
|
|
- SELECT sum(charge) as 'charge', t2.user_id 'userId' FROM ctop_etl_kuaishou_report_account_daily t1
|
|
|
|
|
|
+ SELECT sum (charge) as 'charge', t2.user_id 'userId' FROM ctop_etl_kuaishou_report_account_daily t1
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
WHERE t1.stat_date >= #{mStartDate}
|
|
WHERE t1.stat_date >= #{mStartDate}
|
|
AND t1.stat_date <= #{today}
|
|
AND t1.stat_date <= #{today}
|
|
AND media_id =2
|
|
AND media_id =2
|
|
GROUP BY user_id
|
|
GROUP BY user_id
|
|
- ORDER BY SUM(charge) DESC
|
|
|
|
|
|
+ ORDER BY SUM (charge) DESC
|
|
) t, (select @rownum := 0) a
|
|
) t, (select @rownum := 0) a
|
|
) tt
|
|
) tt
|
|
WHERE tt.userId = #{userId}
|
|
WHERE tt.userId = #{userId}
|
|
@@ -323,6 +323,7 @@
|
|
where stat_date >= #{startTime}
|
|
where stat_date >= #{startTime}
|
|
AND stat_date <= #{endTime}
|
|
AND stat_date <= #{endTime}
|
|
AND t2.user_id = #{userId}
|
|
AND t2.user_id = #{userId}
|
|
|
|
+ AND t6.state = 1
|
|
GROUP BY t2.account_id
|
|
GROUP BY t2.account_id
|
|
<if test="sortCode != '' and sortCode != null ">
|
|
<if test="sortCode != '' and sortCode != null ">
|
|
ORDER BY ${sortCode}
|
|
ORDER BY ${sortCode}
|
|
@@ -391,6 +392,7 @@
|
|
LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
|
|
LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
|
|
where stat_date >= #{startTime}
|
|
where stat_date >= #{startTime}
|
|
AND stat_date <= #{endTime}
|
|
AND stat_date <= #{endTime}
|
|
|
|
+ AND t6.state = 1
|
|
<if test="userIds != null">
|
|
<if test="userIds != null">
|
|
AND t2.user_id IN
|
|
AND t2.user_id IN
|
|
<foreach item="id" index="index" collection="userIds"
|
|
<foreach item="id" index="index" collection="userIds"
|