Commit b0b085bd authored by chenweijian's avatar chenweijian

派对邀请

parent cb0c3638
...@@ -11,6 +11,11 @@ type CvUserLevel struct { ...@@ -11,6 +11,11 @@ type CvUserLevel struct {
} }
type InviteApplyRes struct { type InviteApplyRes struct {
List []*InviteApply `json:"list"`
NumList []*InviteApplyNumRes `json:"numList"`
}
type InviteApply struct {
NewUserCode string `json:"newUserCode"` NewUserCode string `json:"newUserCode"`
Platform string `json:"platform"` Platform string `json:"platform"`
Recharge string `json:"recharge"` Recharge string `json:"recharge"`
...@@ -18,7 +23,6 @@ type InviteApplyRes struct { ...@@ -18,7 +23,6 @@ type InviteApplyRes struct {
CreateUnix int64 `json:"createUnix"` CreateUnix int64 `json:"createUnix"`
Level string `json:"level"` Level string `json:"level"`
Status uint8 `json:"status"` // 状态0.未审核1.已通过2.已拒绝 Status uint8 `json:"status"` // 状态0.未审核1.已通过2.已拒绝
NumList []*InviteApplyNumRes `json:"numList"`
} }
type InviteApplyNumRes struct { type InviteApplyNumRes struct {
......
...@@ -160,15 +160,15 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -160,15 +160,15 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) {
var model = domain.CreateModelContext(myCtx) var model = domain.CreateModelContext(myCtx)
if param.Type == 0 { // 返回所有Type类型有多少条数 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.已拒绝 for _, gType := range []int{1, 2, 3, 4} { // 1.已申请2.待审核3.已通过4.已拒绝
num, err := invite_m.GetInviteApplyNumByType(model, gType, param.BeginTime, param.EndTime) num, err := invite_m.GetInviteApplyNumByType(model, gType, param.BeginTime, param.EndTime)
if err != nil { if err != nil {
return myCtx, err 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 return myCtx, nil
} }
...@@ -195,9 +195,10 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -195,9 +195,10 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) {
model.Log.Errorf("GetApplyList param:%v, err:%v", param, err) model.Log.Errorf("GetApplyList param:%v, err:%v", param, err)
return myCtx, 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 { for _, v := range list {
res = append(res, &invite_cv.InviteApplyRes{ res.List = append(res.List, &invite_cv.InviteApply{
NewUserCode: users[v.NewUserId].Code, NewUserCode: users[v.NewUserId].Code,
Platform: v.Platform, Platform: v.Platform,
Recharge: v.RechargeInfo, 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