diff --git a/src/dao/egg_access_records_dao.go b/src/dao/egg_access_records_dao.go index b8b5ad7..77e1589 100644 --- a/src/dao/egg_access_records_dao.go +++ b/src/dao/egg_access_records_dao.go @@ -6,4 +6,5 @@ type EggAccessRecordsDao interface { //TODO:: You can add specific method definitions here EggAccessRecordsExist(uid int64, date string, index string) (bool, error) EggAccessRecordsInsert(m *model.EggAccessRecords) (int64, error) + EggAccessRecordsDeleteByDateByPage(date string, limit int) (int64, error) } diff --git a/src/implement/egg_access_records_implement.go b/src/implement/egg_access_records_implement.go index 42dcc40..f28016b 100644 --- a/src/implement/egg_access_records_implement.go +++ b/src/implement/egg_access_records_implement.go @@ -31,3 +31,11 @@ func (e EggAccessRecordsDb) EggAccessRecordsInsert(m *model.EggAccessRecords) (i } return m.Id, nil } + +func (e EggAccessRecordsDb) EggAccessRecordsDeleteByDateByPage(date string, limit int) (int64, error) { + affected, err := e.Db.Where("date = ?", date).Limit(limit).Delete(&model.EggAccessRecords{}) + if err != nil { + return 0, zhios_order_relate_logx.Error(err.Error()) + } + return affected, nil +}