Commit b0b085bd authored by chenweijian's avatar chenweijian

派对邀请

parent cb0c3638
......@@ -11,6 +11,11 @@ type CvUserLevel struct {
}
type InviteApplyRes struct {
List []*InviteApply `json:"list"`
NumList []*InviteApplyNumRes `json:"numList"`
}
type InviteApply struct {
NewUserCode string `json:"newUserCode"`
Platform string `json:"platform"`
Recharge string `json:"recharge"`
......@@ -18,7 +23,6 @@ type InviteApplyRes struct {
CreateUnix int64 `json:"createUnix"`
Level string `json:"level"`
Status uint8 `json:"status"` // 状态0.未审核1.已通过2.已拒绝
NumList []*InviteApplyNumRes `json:"numList"`
}
type InviteApplyNumRes struct {
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment