diff --git a/domain/model/invite_m/invite_apply.go b/domain/model/invite_m/invite_apply.go index 66189cc5c80555c6dd824bfed7862c9dbd7ea45e..6eb019835a766de1ef341331a50badf9aa23b39e 100644 --- a/domain/model/invite_m/invite_apply.go +++ b/domain/model/invite_m/invite_apply.go @@ -33,8 +33,9 @@ func CreateInviteApply(model *domain.Model, userId, newUserId, subUserId uint64, return nil } -func GetApplyList(model *domain.Model, userIds []uint64, pageIndex, pageSize, gType int, beginTime, endTime time.Time) ([]*InviteApply, int64, error) { - db := model.DB().Model(InviteApply{}).Where("user_id in (?)", userIds).Where("created_time >= ? and created_time <= ?", beginTime, endTime) +func GetApplyList(model *domain.Model, subUserId uint64, userIds []uint64, pageIndex, pageSize, gType int, beginTime, + 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.已拒绝 case 2: db = db.Where("`status` = ?", 0) diff --git a/route/invite_r/party_invite.go b/route/invite_r/party_invite.go index 3d5640ea9d14e0a91f6a66d6ac738234d9c1471e..705fc823de20223aecadd1cdf457f6a71cac8e35 100644 --- a/route/invite_r/party_invite.go +++ b/route/invite_r/party_invite.go @@ -186,7 +186,7 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { 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 { model.Log.Errorf("GetApplyList param:%v, err:%v", param, err) return myCtx, err