younggee_sec_task_info.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. RewardStage int
  40. UpdateAt string // 更新时间
  41. WithdrawStatus string // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
  42. LeadTeamId string // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
  43. TeamId string // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
  44. TeamIncome string // young之团团长现金收益
  45. TeamPoint string // young之团团长积分收益
  46. ProductId string //商品id
  47. }
  48. // younggeeSecTaskInfoColumns holds the columns for table younggee_sec_task_info.
  49. var younggeeSecTaskInfoColumns = YounggeeSecTaskInfoColumns{
  50. Id: "id",
  51. TaskId: "task_id",
  52. SelectionId: "selection_id",
  53. ProductId: "product_id",
  54. TalentId: "talent_id",
  55. AccountId: "account_id",
  56. TalentPlatformInfoSnap: "talent_platform_info_snap",
  57. TalentPersonalInfoSnap: "talent_personal_info_snap",
  58. TalentPostAddrSnap: "talent_post_addr_snap",
  59. TaskReward: "task_reward",
  60. TalentPayment: "talent_payment",
  61. IsPayPayment: "is_pay_payment",
  62. IsPayReward: "is_pay_reward",
  63. TaskMode: "task_mode",
  64. SampleMode: "sample_mode",
  65. TaskStatus: "task_status",
  66. TaskStage: "task_stage",
  67. CreateDate: "create_date",
  68. SelectDate: "select_date",
  69. DeliveryDate: "delivery_date",
  70. CompleteDate: "complete_date",
  71. WithdrawDate: "withdraw_date",
  72. CompleteStatus: "complete_status",
  73. LogisticsStatus: "logistics_status",
  74. AssignmentStatus: "assignment_status",
  75. UpdateAt: "update_at",
  76. WithdrawStatus: "withdraw_status",
  77. LeadTeamId: "lead_team_id",
  78. TeamId: "team_id",
  79. TeamIncome: "team_income",
  80. TeamPoint: "team_point",
  81. }
  82. // NewYounggeeSecTaskInfoDao creates and returns a new DAO object for table data access.
  83. func NewYounggeeSecTaskInfoDao() *YounggeeSecTaskInfoDao {
  84. return &YounggeeSecTaskInfoDao{
  85. Group: "default",
  86. Table: "younggee_sec_task_info",
  87. Columns: younggeeSecTaskInfoColumns,
  88. }
  89. }
  90. // DB retrieves and returns the underlying raw database management object of current DAO.
  91. func (dao *YounggeeSecTaskInfoDao) DB() gdb.DB {
  92. return g.DB(dao.Group)
  93. }
  94. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  95. func (dao *YounggeeSecTaskInfoDao) Ctx(ctx context.Context) *gdb.Model {
  96. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  97. }
  98. // Transaction wraps the transaction logic using function f.
  99. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  100. // It commits the transaction and returns nil if function f returns nil.
  101. //
  102. // Note that, you should not Commit or Rollback the transaction in function f
  103. // as it is automatically handled by this function.
  104. func (dao *YounggeeSecTaskInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  105. return dao.Ctx(ctx).Transaction(ctx, f)
  106. }