diff --git a/xuanyin-flow-team/xuanyin-flow-team-service/src/main/resources/xuanyin/mappers/FlowTeamSettlementInfoMapper.xml b/xuanyin-flow-team/xuanyin-flow-team-service/src/main/resources/xuanyin/mappers/FlowTeamSettlementInfoMapper.xml
index c77c17a4a..1a5c9efa4 100644
--- a/xuanyin-flow-team/xuanyin-flow-team-service/src/main/resources/xuanyin/mappers/FlowTeamSettlementInfoMapper.xml
+++ b/xuanyin-flow-team/xuanyin-flow-team-service/src/main/resources/xuanyin/mappers/FlowTeamSettlementInfoMapper.xml
@@ -101,7 +101,9 @@
sum(a.totalChargeUserNum) as totalChargeUserNum,
sum(a.totalChargeNum) as totalChargeNum,
sum(a.totalGiveNum) as totalGiveNum,
- sum(a.totalGiveAmount) as totalGiveAmount
+ sum(a.totalGiveAmount) as totalGiveAmount,
+ sum(a.totalGiveUserNum) as totalGiveUserNum,
+ sum(a.newUserGiveAmount) as newUserGiveAmount
from (
select
date_format(u.create_time, '%Y-%m') as `month`,
@@ -111,7 +113,9 @@
0 as totalChargeUserNum,
0 as totalChargeNum,
0 as totalGiveNum,
- 0 as totalGiveAmount
+ 0 as totalGiveAmount,
+ 0 as totalGiveUserNum,
+ 0 as newUserGiveAmount
from flow_team_member_invite_user as fm, users as u
where fm.uid = u.uid
@@ -130,7 +134,9 @@
0 as totalChargeUserNum,
0 as totalChargeNum,
0 as totalGiveNum,
- 0 as totalGiveAmount
+ 0 as totalGiveAmount,
+ 0 as totalGiveUserNum,
+ 0 as newUserGiveAmount
from
flow_team_member_invite_user as fi, users as u, charge_record as r
where fi.uid = r.uid
@@ -155,7 +161,9 @@
count(distinct r.uid) as totalChargeUserNum,
count(r.charge_record_id) as totalChargeNum,
0 as totalGiveNum,
- 0 as totalGiveAmount
+ 0 as totalGiveAmount,
+ 0 as totalGiveUserNum,
+ 0 as newUserGiveAmount
from flow_team_member_invite_user as fi, charge_record as r
where fi.uid = r.uid
and r.charge_status in (2,6)
@@ -180,7 +188,9 @@
0 as totalChargeUserNum,
0 as totalChargeNum,
count(1) as totalGiveNum,
- ifnull(sum(dgh.diamond_num / 1000), 0) as totalGiveAmount
+ ifnull(sum(dgh.diamond_num / 1000), 0) as totalGiveAmount,
+ count(distinct dgh.to_uid) as totalGiveUserNum,
+ 0 as newUserGiveAmount
from flow_team_member_invite_user as fi
inner join diamond_give_history as dgh on dgh.to_uid = fi.uid
where dgh.diamond_num > 0
@@ -194,6 +204,33 @@
group by `month`, fi.team_id
+ union
+ select
+ date_format(dgh.create_time, '%Y-%m') as `month`,
+ 0 as newUserNum,
+ 0 as newUserChargeAmount,
+ 0 as totalChargeAmount,
+ 0 as totalChargeUserNum,
+ 0 as totalChargeNum,
+ 0 as totalGiveNum,
+ 0 as totalGiveAmount,
+ 0 as totalGiveUserNum,
+ ifnull(sum(dgh.diamond_num / 1000), 0) as newUserGiveAmount
+ from flow_team_member_invite_user as fi
+ inner join users as u on u.uid = fi.uid
+ inner join diamond_give_history as dgh on dgh.to_uid = fi.uid
+ where dgh.diamond_num > 0
+ and date_format(dgh.create_time, '%Y-%m') = date_format(u.create_time, '%Y-%m')
+
+ and dgh.create_time >= #{queryLimitTime}
+
+
+ and fi.team_id in
+
+ #{teamId}
+
+
+ group by `month`, fi.team_id
) as a
group by a.`month`