From ff28be91e697c44fa633eef3f7f1d08eb2741613 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Tue, 11 Jul 2023 18:40:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BE=E5=AF=B9=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/model/invite_m/invite_apply.go | 4 ++-- route/invite_r/party_invite.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/domain/model/invite_m/invite_apply.go b/domain/model/invite_m/invite_apply.go index 6eb0198..d876f4f 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 705fc82..b6d1019 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 } -- 2.22.0