diff --git a/src/dao/advertising_callback_dao.go b/src/dao/advertising_callback_dao.go index 2a23cd9..f5afecd 100644 --- a/src/dao/advertising_callback_dao.go +++ b/src/dao/advertising_callback_dao.go @@ -6,6 +6,6 @@ import ( type AdvertisingCallbackDao interface { FindAdvertisingCallbackAndTotal(page, limit, amount, uid, startTime, endTime, platform, types string) (*[]model.AdvertisingCallback, int64, error) - AdvertisingCallbackCount(uid, startTime, endTime, types string) (int64, error) + AdvertisingCallbackCount(uid, startTime, endTime, typePrefix string) (int64, error) AdvertisingCallbackDeleteByDateByPage(date string, limit int) (int64, error) } diff --git a/src/implement/advertising_callback_implement.go b/src/implement/advertising_callback_implement.go index e86639a..0bbd90d 100644 --- a/src/implement/advertising_callback_implement.go +++ b/src/implement/advertising_callback_implement.go @@ -5,6 +5,7 @@ import ( "code.fnuoos.com/EggPlanet/egg_models.git/src/model" zhios_order_relate_utils "code.fnuoos.com/EggPlanet/egg_models.git/utils" zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" + "fmt" "xorm.io/xorm" ) @@ -45,13 +46,14 @@ func (a AdvertisingCallbackDb) FindAdvertisingCallbackAndTotal(page, limit, amou return &m, count, nil } -func (a AdvertisingCallbackDb) AdvertisingCallbackCount(uid, startTime, endTime, types string) (int64, error) { +func (a AdvertisingCallbackDb) AdvertisingCallbackCount(uid, startTime, endTime, typePrefix string) (int64, error) { sess := a.Db.Where("1=1") if uid != "" { sess.And("uid=?", uid) } - if types != "" { - sess.And("type=?", types) + if typePrefix != "" { + types := fmt.Sprintf("type LIKE '%s'", typePrefix+"%") + sess.And(types) } if startTime != "" { sess.And("create_at>=?", startTime)