瀏覽代碼

add egg access recoreds delete

master
shenjiachi 2 週之前
父節點
當前提交
4d30878258
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. +1
    -0
      src/dao/egg_access_records_dao.go
  2. +8
    -0
      src/implement/egg_access_records_implement.go

+ 1
- 0
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)
}

+ 8
- 0
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
}

Loading…
取消
儲存