order_info.go 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. // OrderInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type OrderInfoDao 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 OrderInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // OrderInfoColumns defines and stores column names for table order_info.
  17. type OrderInfoColumns struct {
  18. OrderId string //
  19. TaskId string // 任务id
  20. TaskName string // 任务名称(冗余)
  21. TaskBrandName string // 品牌名称(冗余)
  22. ProductName string // 商品名称(冗余)
  23. ProductMainImg string // 商品主图url(冗余)
  24. TalentId string // 达人id
  25. TalentPlatformInfoSnap string // 达人平台信息快照
  26. TalentPersonalInfoSnap string // 达人个人信息快照
  27. TalentPostAddrSnap string // 收货地址快照
  28. TaskLevelId string // 报名选择的招募等级id(task_recruit_talent_level表中的id)
  29. SettleAmount string // 待结算金额
  30. ProdSpecificationId string // 商品规格列表的索引
  31. ProdNote string // 商品备注
  32. OrderStatus string // 订单状态
  33. CreateDate string // 创建时间
  34. SelectDate string // 反选时间
  35. PartnerWay string // 合作方式
  36. CompleteStatus string // 结束方式 1未结束 2正常结束 3反选失败 4达人取消
  37. CompleteDate string // 结束时间
  38. }
  39. // orderInfoColumns holds the columns for table order_info.
  40. var orderInfoColumns = OrderInfoColumns{
  41. OrderId: "order_id",
  42. TaskId: "task_id",
  43. TaskName: "task_name",
  44. TaskBrandName: "task_brand_name",
  45. ProductName: "product_name",
  46. ProductMainImg: "product_main_img",
  47. TalentId: "talent_id",
  48. TalentPlatformInfoSnap: "talent_platform_info_snap",
  49. TalentPersonalInfoSnap: "talent_personal_info_snap",
  50. TalentPostAddrSnap: "talent_post_addr_snap",
  51. TaskLevelId: "task_level_id",
  52. SettleAmount: "settle_amount",
  53. ProdSpecificationId: "prod_specification_id",
  54. ProdNote: "prod_note",
  55. OrderStatus: "order_status",
  56. CreateDate: "create_date",
  57. SelectDate: "select_date",
  58. PartnerWay: "partner_way",
  59. CompleteStatus: "complete_status",
  60. CompleteDate: "complete_date",
  61. }
  62. // NewOrderInfoDao creates and returns a new DAO object for table data access.
  63. func NewOrderInfoDao() *OrderInfoDao {
  64. return &OrderInfoDao{
  65. Group: "default",
  66. Table: "order_info",
  67. Columns: orderInfoColumns,
  68. }
  69. }
  70. // DB retrieves and returns the underlying raw database management object of current DAO.
  71. func (dao *OrderInfoDao) DB() gdb.DB {
  72. return g.DB(dao.Group)
  73. }
  74. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  75. func (dao *OrderInfoDao) Ctx(ctx context.Context) *gdb.Model {
  76. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  77. }
  78. // Transaction wraps the transaction logic using function f.
  79. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  80. // It commits the transaction and returns nil if function f returns nil.
  81. //
  82. // Note that, you should not Commit or Rollback the transaction in function f
  83. // as it is automatically handled by this function.
  84. func (dao *OrderInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  85. return dao.Ctx(ctx).Transaction(ctx, f)
  86. }