admin_operate_record.go 312 B

1234567891011
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. // ClearAdminOperateRecord 清理用户操作日志
  4. func ClearAdminOperateRecord(date string) (err error) {
  5. o := orm.NewOrmUsingDB("eta")
  6. sql := `DELETE FROM admin_operate_record WHERE create_time <= ?`
  7. _, err = o.Raw(sql, date).Exec()
  8. return
  9. }