wf_run_log.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // ============================================================================
  2. // This is auto-generated by gf cli tool only once. Fill this file as you wish.
  3. // ============================================================================
  4. package wf_run_log
  5. import (
  6. "github.com/gogf/gf/database/gdb"
  7. "github.com/gogf/gf/errors/gerror"
  8. "github.com/gogf/gf/frame/g"
  9. )
  10. type AddData struct {
  11. Uid uint `p:"uid" json:"uid"` // 用户ID
  12. FromId int `p:"from_id" json:"from_id"` // 单据ID
  13. FromTable string `p:"from_table" json:"from_table"` // 单据表
  14. RunId uint `p:"run_id" json:"run_id"` // 流转id
  15. RunFlow uint `p:"run_flow" json:"run_flow"` // 流程ID
  16. Content string `p:"content" json:"content"` // 日志内容
  17. Dateline uint `p:"dateline" json:"dateline"` // 添加时间
  18. Btn string `p:"btn" json:"btn"` // 提交操作信息
  19. Art string `p:"art" json:"art"` // 附件日志
  20. WorkInfo string `p:"work_info" json:"work_info"` // 事务日志
  21. }
  22. func Add(data *AddData, tx *gdb.TX) (err error) {
  23. _, err = Model.TX(tx).Save(data)
  24. if err != nil {
  25. g.Log().Error(err)
  26. err = gerror.New("工作流审批日志记录失败")
  27. }
  28. return
  29. }
  30. func GetRunLog(where g.Map) (entities []*Entity, err error) {
  31. entities, err = Model.FindAll(where)
  32. if err != nil {
  33. g.Log().Error(err)
  34. err = gerror.New("获取日志信息失败")
  35. }
  36. return
  37. }