younggee_sec_task_info.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. package internal
  2. import (
  3. "context"
  4. "github.com/gogf/gf/database/gdb"
  5. "github.com/gogf/gf/frame/g"
  6. )
  7. // YounggeeSecTaskInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  8. type YounggeeSecTaskInfoDao struct {
  9. Table string // Table is the underlying table name of the DAO.
  10. Group string // Group is the database configuration group name of current DAO.
  11. Columns YounggeeSecTaskInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  12. }
  13. // YounggeeSecTaskInfoColumns defines and stores column names for table younggee_sec_task_info.
  14. type YounggeeSecTaskInfoColumns struct {
  15. Id string // 递增id
  16. TaskId string // 选品任务id
  17. SelectionId string // 选品id
  18. TalentId string // 达人id
  19. AccountId string // 账号id
  20. TalentPlatformInfoSnap string // 达人平台信息快照
  21. TalentPersonalInfoSnap string // 达人个人信息快照
  22. TalentPostAddrSnap string // 收货地址快照
  23. TaskReward string // 达人赏金
  24. TalentPayment string // 达人垫付金额
  25. IsPayPayment string // 企业是否返样品钱
  26. IsPayReward string // 企业是否结算悬赏
  27. TaskMode string // 任务形式,1、2分别表示纯佣带货、悬赏任务
  28. SampleMode string // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
  29. TaskStatus string // 任务状态 1待选 2已选 3落选
  30. TaskStage string // 任务阶段,详情见info_sec_task_stage表
  31. CreateDate string // 创建时间
  32. SelectDate string // 反选时间
  33. DeliveryDate string // 发货时间
  34. CompleteDate string // 结束时间
  35. WithdrawDate string // 提现时间
  36. CompleteStatus string // 结束方式 1未结束 2正常结束 3反选失败
  37. LogisticsStatus string // 发货状态 1 待发货 2已发货 3 已签收
  38. AssignmentStatus string // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
  39. UpdateAt string // 更新时间
  40. WithdrawStatus string // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
  41. LeadTeamId string // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
  42. TeamId string // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
  43. TeamIncome string // young之团团长现金收益
  44. TeamPoint string // young之团团长积分收益
  45. ProductId string //商品id
  46. }
  47. // younggeeSecTaskInfoColumns holds the columns for table younggee_sec_task_info.
  48. var younggeeSecTaskInfoColumns = YounggeeSecTaskInfoColumns{
  49. Id: "id",
  50. TaskId: "task_id",
  51. SelectionId: "selection_id",
  52. ProductId: "product_id",
  53. TalentId: "talent_id",
  54. AccountId: "account_id",
  55. TalentPlatformInfoSnap: "talent_platform_info_snap",
  56. TalentPersonalInfoSnap: "talent_personal_info_snap",
  57. TalentPostAddrSnap: "talent_post_addr_snap",
  58. TaskReward: "task_reward",
  59. TalentPayment: "talent_payment",
  60. IsPayPayment: "is_pay_payment",
  61. IsPayReward: "is_pay_reward",
  62. TaskMode: "task_mode",
  63. SampleMode: "sample_mode",
  64. TaskStatus: "task_status",
  65. TaskStage: "task_stage",
  66. CreateDate: "create_date",
  67. SelectDate: "select_date",
  68. DeliveryDate: "delivery_date",
  69. CompleteDate: "complete_date",
  70. WithdrawDate: "withdraw_date",
  71. CompleteStatus: "complete_status",
  72. LogisticsStatus: "logistics_status",
  73. AssignmentStatus: "assignment_status",
  74. UpdateAt: "update_at",
  75. WithdrawStatus: "withdraw_status",
  76. LeadTeamId: "lead_team_id",
  77. TeamId: "team_id",
  78. TeamIncome: "team_income",
  79. TeamPoint: "team_point",
  80. }
  81. // NewYounggeeSecTaskInfoDao creates and returns a new DAO object for table data access.
  82. func NewYounggeeSecTaskInfoDao() *YounggeeSecTaskInfoDao {
  83. return &YounggeeSecTaskInfoDao{
  84. Group: "default",
  85. Table: "younggee_sec_task_info",
  86. Columns: younggeeSecTaskInfoColumns,
  87. }
  88. }
  89. // DB retrieves and returns the underlying raw database management object of current DAO.
  90. func (dao *YounggeeSecTaskInfoDao) DB() gdb.DB {
  91. return g.DB(dao.Group)
  92. }
  93. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  94. func (dao *YounggeeSecTaskInfoDao) Ctx(ctx context.Context) *gdb.Model {
  95. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  96. }
  97. // Transaction wraps the transaction logic using function f.
  98. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  99. // It commits the transaction and returns nil if function f returns nil.
  100. //
  101. // Note that, you should not Commit or Rollback the transaction in function f
  102. // as it is automatically handled by this function.
  103. func (dao *YounggeeSecTaskInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  104. return dao.Ctx(ctx).Transaction(ctx, f)
  105. }