shanghai_company_log.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxShanghaiCompanyLog struct {
  7. Id int `orm:"column(id);pk"`
  8. Url string
  9. Body string
  10. Result string
  11. CreateTime time.Time
  12. }
  13. //添加日志记录
  14. func AddCygxShanghaiCompanyLog(item *CygxShanghaiCompanyLog) (lastId int64, err error) {
  15. o := orm.NewOrm()
  16. lastId, err = o.Insert(item)
  17. return
  18. }
  19. type CygxShanghaiErrLog struct {
  20. Id int `orm:"column(id);pk"`
  21. ErrVal string
  22. ErrMsg string
  23. ErrType string
  24. CreateTime time.Time
  25. }
  26. //添加日志记录
  27. func AddCygxShanghaiErrLog(item *CygxShanghaiErrLog) (lastId int64, err error) {
  28. o := orm.NewOrm()
  29. lastId, err = o.Insert(item)
  30. return
  31. }
  32. //列表
  33. func GetCygxShanghaiCompanyLog() (items []*CygxShanghaiCompanyLog, err error) {
  34. o := orm.NewOrm()
  35. sql := ` SELECT * FROM cygx_shanghai_company_log WHERE create_time > date_format(now(),'%Y-%m-%d') AND url LIKE '%Customer/batchSyncFiccCustomer%'`
  36. _, err = o.Raw(sql).QueryRows(&items)
  37. return
  38. }