From 340ce34a0fa997c83b199e26b07ee352020ce114 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 19 Dec 2024 14:35:36 +0800 Subject: [PATCH] fix team assistance count --- src/dao/advertising_callback_dao.go | 2 +- src/implement/advertising_callback_implement.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dao/advertising_callback_dao.go b/src/dao/advertising_callback_dao.go index 567d4c1..4541b2c 100644 --- a/src/dao/advertising_callback_dao.go +++ b/src/dao/advertising_callback_dao.go @@ -7,5 +7,5 @@ import ( type AdvertisingCallbackDao interface { FindAdvertisingCallbackAndTotal(page, limit, amount, uid, startTime, endTime, platform, types string) (*[]model.AdvertisingCallback, int64, error) - AdvertisingCallbackExistBySession(session *xorm.Session, uid, startTime, endTime, types string) (bool, error) + AdvertisingCallbackCountBySession(session *xorm.Session, uid, startTime, endTime, types string) (int64, error) } diff --git a/src/implement/advertising_callback_implement.go b/src/implement/advertising_callback_implement.go index e80dab8..1a2d60a 100644 --- a/src/implement/advertising_callback_implement.go +++ b/src/implement/advertising_callback_implement.go @@ -45,7 +45,7 @@ func (a AdvertisingCallbackDb) FindAdvertisingCallbackAndTotal(page, limit, amou return &m, count, nil } -func (a AdvertisingCallbackDb) AdvertisingCallbackExistBySession(session *xorm.Session, uid, startTime, endTime, types string) (bool, error) { +func (a AdvertisingCallbackDb) AdvertisingCallbackCountBySession(session *xorm.Session, uid, startTime, endTime, types string) (int64, error) { var m []model.AdvertisingCallback sess := session.Where("1=1") if uid != "" { @@ -60,9 +60,9 @@ func (a AdvertisingCallbackDb) AdvertisingCallbackExistBySession(session *xorm.S if endTime != "" { sess.And("create_at<=?", endTime) } - exist, err := sess.Exist(&m) + count, err := sess.Count(&m) if err != nil { return false, err } - return exist, nil + return count, nil }