diff --git a/domain/model/invite_m/invite_apply.go b/domain/model/invite_m/invite_apply.go index 6eb019835a766de1ef341331a50badf9aa23b39e..d876f4ffd91f9e80d120106d381f0e3b6181e2f5 100644 --- a/domain/model/invite_m/invite_apply.go +++ b/domain/model/invite_m/invite_apply.go @@ -68,9 +68,9 @@ func IsInInviteApply(model *domain.Model, userId mysql.ID) (bool, error) { } // 检查被邀请人是否存在 -func GetInviteApplyNumByType(model *domain.Model, gType int, beginTime, endTime time.Time, userIds []uint64) (int, error) { +func GetInviteApplyNumByType(model *domain.Model, gType int, beginTime, endTime time.Time, userIds []uint64, subUserId uint64) (int, error) { var count int64 - db := model.Db.Model(InviteApply{}).Where("user_id in (?)", userIds).Where("created_time >= ? and created_time <= ?", beginTime, endTime) + 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 705fc823de20223aecadd1cdf457f6a71cac8e35..b6d1019562d245b5e9a7a378cf5b7867c5744078 100644 --- a/route/invite_r/party_invite.go +++ b/route/invite_r/party_invite.go @@ -176,7 +176,7 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { } 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, agentIds) + num, err := invite_m.GetInviteApplyNumByType(model, gType, param.BeginTime, param.EndTime, agentIds, userId) if err != nil { return myCtx, err }