wx_pay_order.go 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // ==========================================================================
  2. // Code generated by GoFrame CLI tool. DO NOT EDIT.
  3. // ==========================================================================
  4. package internal
  5. import (
  6. "context"
  7. "github.com/gogf/gf/database/gdb"
  8. "github.com/gogf/gf/frame/g"
  9. )
  10. // WxPayOrderDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type WxPayOrderDao struct {
  12. Table string // Table is the underlying table name of the DAO.
  13. Group string // Group is the database configuration group name of current DAO.
  14. Columns WxPayOrderColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // WxPayOrderColumns defines and stores column names for table wx_pay_order.
  17. type WxPayOrderColumns struct {
  18. OrderId string //
  19. OutTradeNo string // 本平台的订单号
  20. WxOrderNo string // 微信产生的订单号
  21. PayAmount string // 支付金额
  22. TaskName string // 任务名称
  23. PayReason string // 支付用途 1拍单
  24. TalentId string // 达人id
  25. TalentWxNickname string // 达人微信昵称
  26. TalentPlatformAccountName string // 达人平台账号昵称
  27. TaskId string // 任务id
  28. TaskPlatform string // 任务的社媒平台id
  29. Success string // 是否成功
  30. CreateAt string // 订单生成时间
  31. Desc string // 描述
  32. }
  33. // wxPayOrderColumns holds the columns for table wx_pay_order.
  34. var wxPayOrderColumns = WxPayOrderColumns{
  35. OrderId: "order_id",
  36. OutTradeNo: "out_trade_no",
  37. WxOrderNo: "wx_order_no",
  38. PayAmount: "pay_amount",
  39. TaskName: "task_name",
  40. PayReason: "pay_reason",
  41. TalentId: "talent_id",
  42. TalentWxNickname: "talent_wx_nickname",
  43. TalentPlatformAccountName: "talent_platform_account_name",
  44. TaskId: "task_id",
  45. TaskPlatform: "task_platform",
  46. Success: "success",
  47. CreateAt: "create_at",
  48. Desc: "desc",
  49. }
  50. // NewWxPayOrderDao creates and returns a new DAO object for table data access.
  51. func NewWxPayOrderDao() *WxPayOrderDao {
  52. return &WxPayOrderDao{
  53. Group: "default",
  54. Table: "wx_pay_order",
  55. Columns: wxPayOrderColumns,
  56. }
  57. }
  58. // DB retrieves and returns the underlying raw database management object of current DAO.
  59. func (dao *WxPayOrderDao) DB() gdb.DB {
  60. return g.DB(dao.Group)
  61. }
  62. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  63. func (dao *WxPayOrderDao) Ctx(ctx context.Context) *gdb.Model {
  64. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  65. }
  66. // Transaction wraps the transaction logic using function f.
  67. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  68. // It commits the transaction and returns nil if function f returns nil.
  69. //
  70. // Note that, you should not Commit or Rollback the transaction in function f
  71. // as it is automatically handled by this function.
  72. func (dao *WxPayOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  73. return dao.Ctx(ctx).Transaction(ctx, f)
  74. }