provider_del_old_count.go 566 B

123456789101112131415161718192021
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package provider
  4. import (
  5. "context"
  6. "gd_management/apis"
  7. "gd_management/errors"
  8. "github.com/astaxie/beego/orm"
  9. )
  10. func ManagementDelProviderOldCount(ctx context.Context, req *apis.ManagementDelProviderOldCountReq, reply *apis.ManagementDelProviderOldCountReply) error {
  11. o := orm.NewOrm()
  12. _, err := o.Raw("delete from t_gd_thirdpart_access_count where create_time < ?", req.Date).Exec()
  13. if err != nil {
  14. return errors.DataBaseError
  15. }
  16. return nil
  17. }