From b0b085bdee385fb2183e8be45ff7d0dd6c2b81a4 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Fri, 30 Jun 2023 17:27:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BE=E5=AF=B9=E9=82=80=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv/invite_cv/invite_apply.go | 20 ++++++++++++-------- route/invite_r/party_invite.go | 11 ++++++----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/cv/invite_cv/invite_apply.go b/cv/invite_cv/invite_apply.go index 25e3289..e598d49 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 8f508c9..3f7355c 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, -- 2.22.0