diff --git a/src/dao/advertising_callback_dao.go b/src/dao/advertising_callback_dao.go index 31f7036..2a23cd9 100644 --- a/src/dao/advertising_callback_dao.go +++ b/src/dao/advertising_callback_dao.go @@ -7,4 +7,5 @@ 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) + AdvertisingCallbackDeleteByDateByPage(date string, limit int) (int64, error) } diff --git a/src/implement/advertising_callback_implement.go b/src/implement/advertising_callback_implement.go index 1980006..6ae2f43 100644 --- a/src/implement/advertising_callback_implement.go +++ b/src/implement/advertising_callback_implement.go @@ -65,3 +65,11 @@ func (a AdvertisingCallbackDb) AdvertisingCallbackCount(uid, startTime, endTime, } return count, nil } + +func (a AdvertisingCallbackDb) AdvertisingCallbackDeleteByDateByPage(date string, limit int) (int64, error) { + affected, err := a.Db.Where("create_at < ?", date).Limit(limit).Delete(&model.EggAccessRecords{}) + if err != nil { + return 0, zhios_order_relate_logx.Error(err.Error()) + } + return affected, nil +}