diff --git a/cv/invite_cv/invite_apply.go b/cv/invite_cv/invite_apply.go index 25e328955acfde315dad1c85767baf03ee15e088..e598d49c2431a216286ac284865d89adf047d39c 100644 --- a/cv/invite_cv/invite_apply.go +++ b/cv/invite_cv/invite_apply.go @@ -11,14 +11,18 @@ type CvUserLevel struct { } type InviteApplyRes struct { - NewUserCode string `json:"newUserCode"` - Platform string `json:"platform"` - Recharge string `json:"recharge"` - UserCode string `json:"userCode"` - CreateUnix int64 `json:"createUnix"` - Level string `json:"level"` - Status uint8 `json:"status"` // 状态0.未审核1.已通过2.已拒绝 - NumList []*InviteApplyNumRes `json:"numList"` + List []*InviteApply `json:"list"` + NumList []*InviteApplyNumRes `json:"numList"` +} + +type InviteApply struct { + NewUserCode string `json:"newUserCode"` + Platform string `json:"platform"` + Recharge string `json:"recharge"` + UserCode string `json:"userCode"` + CreateUnix int64 `json:"createUnix"` + Level string `json:"level"` + Status uint8 `json:"status"` // 状态0.未审核1.已通过2.已拒绝 } type InviteApplyNumRes struct { diff --git a/route/invite_r/party_invite.go b/route/invite_r/party_invite.go index 8f508c9d16d54dd159eaa2aa2a6289013b9055e9..3f7355cead51c6f2c7a5054ba4f6268e8c9701a0 100644 --- a/route/invite_r/party_invite.go +++ b/route/invite_r/party_invite.go @@ -160,15 +160,15 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { var model = domain.CreateModelContext(myCtx) if param.Type == 0 { // 返回所有Type类型有多少条数 - res := &invite_cv.InviteApplyRes{NumList: make([]*invite_cv.InviteApplyNumRes, 0, 4)} + numList := make([]*invite_cv.InviteApplyNumRes, 0, 4) for _, gType := range []int{1, 2, 3, 4} { // 1.已申请2.待审核3.已通过4.已拒绝 num, err := invite_m.GetInviteApplyNumByType(model, gType, param.BeginTime, param.EndTime) if err != nil { return myCtx, err } - res.NumList = append(res.NumList, &invite_cv.InviteApplyNumRes{Type: gType, Num: num}) + numList = append(numList, &invite_cv.InviteApplyNumRes{Type: gType, Num: num}) } - resp.ResponsePageOk(c, []*invite_cv.InviteApplyRes{res}, 0, 0, 0) + resp.ResponsePageOk(c, &invite_cv.InviteApplyRes{NumList: numList}, 0, 0, 0) return myCtx, nil } @@ -195,9 +195,10 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { model.Log.Errorf("GetApplyList param:%v, err:%v", param, err) return myCtx, err } - res := make([]*invite_cv.InviteApplyRes, 0, len(list)) + res := &invite_cv.InviteApplyRes{} + res.List = make([]*invite_cv.InviteApply, 0, len(list)) for _, v := range list { - res = append(res, &invite_cv.InviteApplyRes{ + res.List = append(res.List, &invite_cv.InviteApply{ NewUserCode: users[v.NewUserId].Code, Platform: v.Platform, Recharge: v.RechargeInfo,