f
This commit is contained in:
@@ -314,7 +314,8 @@ func (l *GetTeamListLogic) buildTeamMemberItem(agentId string, member *model.Age
|
||||
monthQueries := l.countDistinctOrdersForMember(l.ctx, monthRebateBuilder)
|
||||
|
||||
// 统计返佣给我的金额(从agent_rebate表,source_agent_id = member.Id, agent_id = agentId)
|
||||
// 原返佣统计字段已在新需求中不再下发给前端,这里暂不计算金额,后续如有需要可在 .api 中重新定义并补充实现
|
||||
totalRebateAmount, _ := l.svcCtx.AgentRebateModel.FindSum(l.ctx, rebateBuilder, "rebate_amount")
|
||||
todayRebateAmount, _ := l.svcCtx.AgentRebateModel.FindSum(l.ctx, rebateBuilder.Where("create_time >= ?", todayStart), "rebate_amount")
|
||||
|
||||
// 统计邀请人数(从agent_relation表,parent_id = member.Id)
|
||||
inviteBuilder := l.svcCtx.AgentRelationModel.SelectBuilder().
|
||||
@@ -327,17 +328,19 @@ func (l *GetTeamListLogic) buildTeamMemberItem(agentId string, member *model.Age
|
||||
isDirect := directSubordinateIds[member.Id]
|
||||
|
||||
return types.TeamMemberItem{
|
||||
AgentId: member.Id,
|
||||
Level: member.Level,
|
||||
LevelName: levelName,
|
||||
Mobile: mobile,
|
||||
CreateTime: member.CreateTime.Format("2006-01-02 15:04:05"),
|
||||
TodayInvites: todayInvites,
|
||||
MonthInvites: monthInvites,
|
||||
TotalInvites: totalInvites,
|
||||
TodayQueries: todayQueries,
|
||||
MonthQueries: monthQueries,
|
||||
TotalQueries: totalQueries,
|
||||
IsDirect: isDirect,
|
||||
AgentId: member.Id,
|
||||
Level: member.Level,
|
||||
LevelName: levelName,
|
||||
Mobile: mobile,
|
||||
CreateTime: member.CreateTime.Format("2006-01-02 15:04:05"),
|
||||
TodayInvites: todayInvites,
|
||||
MonthInvites: monthInvites,
|
||||
TotalInvites: totalInvites,
|
||||
TodayQueries: todayQueries,
|
||||
MonthQueries: monthQueries,
|
||||
TotalQueries: totalQueries,
|
||||
TotalRebateAmount: totalRebateAmount,
|
||||
TodayRebateAmount: todayRebateAmount,
|
||||
IsDirect: isDirect,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,18 +500,20 @@ type SubordinateItem struct {
|
||||
}
|
||||
|
||||
type TeamMemberItem struct {
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
Level int64 `json:"level"` // 等级
|
||||
LevelName string `json:"level_name"` // 等级名称
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
CreateTime string `json:"create_time"` // 加入团队时间
|
||||
TodayInvites int64 `json:"today_invites"` // 邀请加入团队的今日人数
|
||||
MonthInvites int64 `json:"month_invites"` // 邀请加入团队的本月人数
|
||||
TotalInvites int64 `json:"total_invites"` // 邀请加入团队的总人数
|
||||
TodayQueries int64 `json:"today_queries"` // 当日查询量
|
||||
MonthQueries int64 `json:"month_queries"` // 本月查询量
|
||||
TotalQueries int64 `json:"total_queries"` // 总查询量
|
||||
IsDirect bool `json:"is_direct"` // 是否直接下级
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
Level int64 `json:"level"` // 等级
|
||||
LevelName string `json:"level_name"` // 等级名称
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
CreateTime string `json:"create_time"` // 加入团队时间
|
||||
TotalRebateAmount float64 `json:"total_rebate_amount"` // 返佣给我的总金额
|
||||
TodayRebateAmount float64 `json:"today_rebate_amount"` // 返佣给我的今日金额
|
||||
TodayInvites int64 `json:"today_invites"` // 邀请加入团队的今日人数
|
||||
MonthInvites int64 `json:"month_invites"` // 邀请加入团队的本月人数
|
||||
TotalInvites int64 `json:"total_invites"` // 邀请加入团队的总人数
|
||||
TodayQueries int64 `json:"today_queries"` // 当日查询量
|
||||
MonthQueries int64 `json:"month_queries"` // 本月查询量
|
||||
TotalQueries int64 `json:"total_queries"` // 总查询量
|
||||
IsDirect bool `json:"is_direct"` // 是否直接下级
|
||||
}
|
||||
|
||||
type TeamStatistics struct {
|
||||
|
||||
Reference in New Issue
Block a user