Commit 8e972860 authored by chenweijian's avatar chenweijian

派对申请

parent f9845e27
...@@ -33,8 +33,9 @@ func CreateInviteApply(model *domain.Model, userId, newUserId, subUserId uint64, ...@@ -33,8 +33,9 @@ func CreateInviteApply(model *domain.Model, userId, newUserId, subUserId uint64,
return nil return nil
} }
func GetApplyList(model *domain.Model, userIds []uint64, pageIndex, pageSize, gType int, beginTime, endTime time.Time) ([]*InviteApply, int64, error) { func GetApplyList(model *domain.Model, subUserId uint64, userIds []uint64, pageIndex, pageSize, gType int, beginTime,
db := model.DB().Model(InviteApply{}).Where("user_id in (?)", userIds).Where("created_time >= ? and created_time <= ?", beginTime, endTime) endTime time.Time) ([]*InviteApply, int64, error) {
db := model.DB().Model(InviteApply{}).Where("user_id in (?) or sub_user_id = ?", userIds, subUserId).Where("created_time >= ? and created_time <= ?", beginTime, endTime)
switch gType { // 1.已申请2.待审核3.已通过4.已拒绝 switch gType { // 1.已申请2.待审核3.已通过4.已拒绝
case 2: case 2:
db = db.Where("`status` = ?", 0) db = db.Where("`status` = ?", 0)
......
...@@ -186,7 +186,7 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -186,7 +186,7 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, nil return myCtx, nil
} }
list, total, err := invite_m.GetApplyList(model, agentIds, param.PageIndex, param.PageSize, param.Type, param.BeginTime, param.EndTime) list, total, err := invite_m.GetApplyList(model, userId, agentIds, param.PageIndex, param.PageSize, param.Type, param.BeginTime, param.EndTime)
if err != nil { if err != nil {
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
......
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