From 10bc945b358f727d8ef00c93402eb74df1011d44 Mon Sep 17 00:00:00 2001 From: Tooooommy Date: Fri, 25 Sep 2020 15:42:38 +0800 Subject: [PATCH] fix:bug --- controllers/client/sign.go | 2 +- models/sign_history.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/client/sign.go b/controllers/client/sign.go index 714f148..ae667ee 100644 --- a/controllers/client/sign.go +++ b/controllers/client/sign.go @@ -162,7 +162,7 @@ func (t *SignCtl) Sign() { } // 签到人数 - signTotal, err := history.Count(signUp.Id, activity.Id, activity.ArchId, activity.RehearsalId) + signTotal, err := history.Count(signUp.Id, activity.Id, activity.ArchId, activity.RehearsalId, 2) t.CheckErr(err) signUpTotal, err := new(models.InvitationLetter).Count(activity.Id, activity.ArchId, activity.RehearsalId) diff --git a/models/sign_history.go b/models/sign_history.go index 8f76e3a..6b4ada6 100644 --- a/models/sign_history.go +++ b/models/sign_history.go @@ -36,11 +36,11 @@ func (t *SignHistory) GetByUserId(activityId, archId, userId, rehearsalId, areaI "rehearsal_id=? and area_id=?", activityId, archId, userId, rehearsalId, areaId).Get(t) } -func (t *SignHistory) Count(signUpId, activityId, archId, rehearsalId interface{}) (int64, error) { +func (t *SignHistory) Count(signUpId, activityId, archId, rehearsalId, status interface{}) (int64, error) { // 签到人数 return core.GetXormAuto().Where("is_delete=0 and sign_rule_id=? and "+ - " activity_id=? and arch_id=? and rehearsal_id=? and status=2", - signUpId, activityId, archId, rehearsalId).Count(t) + " activity_id=? and arch_id=? and rehearsal_id=? and status=?", + signUpId, activityId, archId, rehearsalId, status).Count(t) } func (t *SignHistory) UpdateByIds(ids interface{}, fields ...string) (err error) {