fix revenuei
This commit is contained in:
parent
f6675cc6d9
commit
0bdaa141bd
@ -31,9 +31,31 @@ func NewGetAgentRevenueInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func (l *GetAgentRevenueInfoLogic) GetAgentRevenueInfo(req *types.GetAgentRevenueInfoReq) (resp *types.GetAgentRevenueInfoResp, err error) {
|
||||
userID, err := ctxdata.GetUidFromCtx(l.ctx)
|
||||
claims, err := ctxdata.GetClaimsFromCtx(l.ctx)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "获取代理奖励, %v", err)
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "获取代理信息, %v", err)
|
||||
}
|
||||
userID := claims.UserId
|
||||
userType := claims.UserType
|
||||
if userType == model.UserTypeTemp {
|
||||
return &types.GetAgentRevenueInfoResp{
|
||||
Balance: 0,
|
||||
TotalEarnings: 0,
|
||||
FrozenBalance: 0,
|
||||
DirectPush: types.DirectPushReport{
|
||||
TotalCommission: 0,
|
||||
TotalReport: 0,
|
||||
Today: types.TimeRangeReport{},
|
||||
Last7D: types.TimeRangeReport{},
|
||||
Last30D: types.TimeRangeReport{},
|
||||
},
|
||||
ActiveReward: types.ActiveReward{
|
||||
TotalReward: 0,
|
||||
Today: types.ActiveRewardData{},
|
||||
Last7D: types.ActiveRewardData{},
|
||||
Last30D: types.ActiveRewardData{},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
agentModel, err := l.svcCtx.AgentModel.FindOneByUserId(l.ctx, userID)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user