f
This commit is contained in:
@@ -408,18 +408,20 @@ type (
|
|||||||
MonthEarnings float64 `json:"month_earnings"` // 月收益
|
MonthEarnings float64 `json:"month_earnings"` // 月收益
|
||||||
}
|
}
|
||||||
TeamMemberItem {
|
TeamMemberItem {
|
||||||
AgentId string `json:"agent_id"` // 代理ID
|
AgentId string `json:"agent_id"` // 代理ID
|
||||||
Level int64 `json:"level"` // 等级
|
Level int64 `json:"level"` // 等级
|
||||||
LevelName string `json:"level_name"` // 等级名称
|
LevelName string `json:"level_name"` // 等级名称
|
||||||
Mobile string `json:"mobile"` // 手机号
|
Mobile string `json:"mobile"` // 手机号
|
||||||
CreateTime string `json:"create_time"` // 加入团队时间
|
CreateTime string `json:"create_time"` // 加入团队时间
|
||||||
TodayInvites int64 `json:"today_invites"` // 邀请加入团队的今日人数
|
TotalRebateAmount float64 `json:"total_rebate_amount"` // 返佣给我的总金额
|
||||||
MonthInvites int64 `json:"month_invites"` // 邀请加入团队的本月人数
|
TodayRebateAmount float64 `json:"today_rebate_amount"` // 返佣给我的今日金额
|
||||||
TotalInvites int64 `json:"total_invites"` // 邀请加入团队的总人数
|
TodayInvites int64 `json:"today_invites"` // 邀请加入团队的今日人数
|
||||||
TodayQueries int64 `json:"today_queries"` // 当日查询量
|
MonthInvites int64 `json:"month_invites"` // 邀请加入团队的本月人数
|
||||||
MonthQueries int64 `json:"month_queries"` // 本月查询量
|
TotalInvites int64 `json:"total_invites"` // 邀请加入团队的总人数
|
||||||
TotalQueries int64 `json:"total_queries"` // 总查询量
|
TodayQueries int64 `json:"today_queries"` // 当日查询量
|
||||||
IsDirect bool `json:"is_direct"` // 是否直接下级
|
MonthQueries int64 `json:"month_queries"` // 本月查询量
|
||||||
|
TotalQueries int64 `json:"total_queries"` // 总查询量
|
||||||
|
IsDirect bool `json:"is_direct"` // 是否直接下级
|
||||||
}
|
}
|
||||||
// 收益信息
|
// 收益信息
|
||||||
GetRevenueInfoResp {
|
GetRevenueInfoResp {
|
||||||
|
|||||||
@@ -314,7 +314,8 @@ func (l *GetTeamListLogic) buildTeamMemberItem(agentId string, member *model.Age
|
|||||||
monthQueries := l.countDistinctOrdersForMember(l.ctx, monthRebateBuilder)
|
monthQueries := l.countDistinctOrdersForMember(l.ctx, monthRebateBuilder)
|
||||||
|
|
||||||
// 统计返佣给我的金额(从agent_rebate表,source_agent_id = member.Id, agent_id = agentId)
|
// 统计返佣给我的金额(从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)
|
// 统计邀请人数(从agent_relation表,parent_id = member.Id)
|
||||||
inviteBuilder := l.svcCtx.AgentRelationModel.SelectBuilder().
|
inviteBuilder := l.svcCtx.AgentRelationModel.SelectBuilder().
|
||||||
@@ -327,17 +328,19 @@ func (l *GetTeamListLogic) buildTeamMemberItem(agentId string, member *model.Age
|
|||||||
isDirect := directSubordinateIds[member.Id]
|
isDirect := directSubordinateIds[member.Id]
|
||||||
|
|
||||||
return types.TeamMemberItem{
|
return types.TeamMemberItem{
|
||||||
AgentId: member.Id,
|
AgentId: member.Id,
|
||||||
Level: member.Level,
|
Level: member.Level,
|
||||||
LevelName: levelName,
|
LevelName: levelName,
|
||||||
Mobile: mobile,
|
Mobile: mobile,
|
||||||
CreateTime: member.CreateTime.Format("2006-01-02 15:04:05"),
|
CreateTime: member.CreateTime.Format("2006-01-02 15:04:05"),
|
||||||
TodayInvites: todayInvites,
|
TodayInvites: todayInvites,
|
||||||
MonthInvites: monthInvites,
|
MonthInvites: monthInvites,
|
||||||
TotalInvites: totalInvites,
|
TotalInvites: totalInvites,
|
||||||
TodayQueries: todayQueries,
|
TodayQueries: todayQueries,
|
||||||
MonthQueries: monthQueries,
|
MonthQueries: monthQueries,
|
||||||
TotalQueries: totalQueries,
|
TotalQueries: totalQueries,
|
||||||
IsDirect: isDirect,
|
TotalRebateAmount: totalRebateAmount,
|
||||||
|
TodayRebateAmount: todayRebateAmount,
|
||||||
|
IsDirect: isDirect,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -500,18 +500,20 @@ type SubordinateItem struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TeamMemberItem struct {
|
type TeamMemberItem struct {
|
||||||
AgentId string `json:"agent_id"` // 代理ID
|
AgentId string `json:"agent_id"` // 代理ID
|
||||||
Level int64 `json:"level"` // 等级
|
Level int64 `json:"level"` // 等级
|
||||||
LevelName string `json:"level_name"` // 等级名称
|
LevelName string `json:"level_name"` // 等级名称
|
||||||
Mobile string `json:"mobile"` // 手机号
|
Mobile string `json:"mobile"` // 手机号
|
||||||
CreateTime string `json:"create_time"` // 加入团队时间
|
CreateTime string `json:"create_time"` // 加入团队时间
|
||||||
TodayInvites int64 `json:"today_invites"` // 邀请加入团队的今日人数
|
TotalRebateAmount float64 `json:"total_rebate_amount"` // 返佣给我的总金额
|
||||||
MonthInvites int64 `json:"month_invites"` // 邀请加入团队的本月人数
|
TodayRebateAmount float64 `json:"today_rebate_amount"` // 返佣给我的今日金额
|
||||||
TotalInvites int64 `json:"total_invites"` // 邀请加入团队的总人数
|
TodayInvites int64 `json:"today_invites"` // 邀请加入团队的今日人数
|
||||||
TodayQueries int64 `json:"today_queries"` // 当日查询量
|
MonthInvites int64 `json:"month_invites"` // 邀请加入团队的本月人数
|
||||||
MonthQueries int64 `json:"month_queries"` // 本月查询量
|
TotalInvites int64 `json:"total_invites"` // 邀请加入团队的总人数
|
||||||
TotalQueries int64 `json:"total_queries"` // 总查询量
|
TodayQueries int64 `json:"today_queries"` // 当日查询量
|
||||||
IsDirect bool `json:"is_direct"` // 是否直接下级
|
MonthQueries int64 `json:"month_queries"` // 本月查询量
|
||||||
|
TotalQueries int64 `json:"total_queries"` // 总查询量
|
||||||
|
IsDirect bool `json:"is_direct"` // 是否直接下级
|
||||||
}
|
}
|
||||||
|
|
||||||
type TeamStatistics struct {
|
type TeamStatistics struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user