|
@@ -280,6 +280,8 @@
|
|
|
d.project_name AS projectName,
|
|
|
COUNT( DISTINCT d.user_id ) AS userNum,
|
|
|
( SELECT u.realname FROM `jeecg-boot`.sys_user u WHERE u.id = d.user_id ) AS userName,
|
|
|
+ (SELECT u.warning_amount FROM `jeecg-boot`.ctop_user_allocation u where u.account_id = d.account_id) as warningAmount,
|
|
|
+ (SELECT u.balance FROM media_api.kuaishou_advertiser_fund_get u where u.advertiser_id = d.account_id ORDER BY stat_date DESC limit 1 ) as balance,
|
|
|
IFNULL(SUM( d.activation ),0) AS activation,
|
|
|
IFNULL(ROUND( SUM( d.charge ) / SUM( d.activation ), 2 ),0) AS activationPrice,
|
|
|
IF(SUM( d.event_next_day_stay ) / SUM( d.activation ) > 0.0001,CONCAT(ROUND(SUM( d.event_next_day_stay ) / SUM( d.activation ) * 100, 2 ),'%'),0) AS leave,
|
|
@@ -356,17 +358,11 @@
|
|
|
<!-- 快手 账户 余额 -->
|
|
|
<select id="getKuaiShouAccountBalance" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT
|
|
|
- d.total_charged_in_yuan as totalCost,
|
|
|
- d.total_balance_in_yuan as balance
|
|
|
- FROM application.app_kuaishou_agent_report_d d
|
|
|
- <where>
|
|
|
- <if test="accountId != null and accountId != '' ">
|
|
|
- and d.account_id = #{accountId}
|
|
|
- </if>
|
|
|
- <if test="statDate != null and statDate != '' ">
|
|
|
- and d.stat_date = #{statDate}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ advertiser_id as accountId,
|
|
|
+ balance
|
|
|
+ FROM media_api.kuaishou_advertiser_fund_get
|
|
|
+ where d.account_id = #{accountId}
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
|