younggee_talent_income.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. // YounggeeTalentIncomeDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YounggeeTalentIncomeDao 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 YounggeeTalentIncomeColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YounggeeTalentIncomeColumns defines and stores column names for table younggee_talent_income.
  17. type YounggeeTalentIncomeColumns struct {
  18. Id string // 递增id
  19. TalentId string // 达人id,对应youngee_talent_info中id字段
  20. ProjectId string // 项目id
  21. SelectionId string // 选品id
  22. TaskId string // 任务id
  23. SectaskId string // 选品任务id
  24. BrandName string // 品牌名称
  25. TaskName string // 任务名称
  26. TeamId string // young之团id
  27. Income string // 收益金额
  28. IncomeType string // 收益类型,1-4分别表示任务收益、开团收益、样品返现、悬赏收益
  29. WithdrawStatus string // 提现状态,1-3分别表示可提现、提现中、已提现
  30. IncomeAt string // 收益产生时间
  31. WithdrawAt string // 提现时间
  32. PhotoUrl string // 商品主图
  33. Type string // 选品or项目,1:项目,2:选品
  34. }
  35. // younggeeTalentIncomeColumns holds the columns for table younggee_talent_income.
  36. var younggeeTalentIncomeColumns = YounggeeTalentIncomeColumns{
  37. Id: "id",
  38. TalentId: "talent_id",
  39. ProjectId: "project_id",
  40. SelectionId: "selection_id",
  41. TaskId: "task_id",
  42. SectaskId: "sectask_id",
  43. BrandName: "brand_name",
  44. TaskName: "task_name",
  45. TeamId: "team_id",
  46. Income: "income",
  47. IncomeType: "income_type",
  48. WithdrawStatus: "withdraw_status",
  49. IncomeAt: "income_at",
  50. WithdrawAt: "withdraw_at",
  51. PhotoUrl: "photo_url",
  52. Type: "type",
  53. }
  54. // NewYounggeeTalentIncomeDao creates and returns a new DAO object for table data access.
  55. func NewYounggeeTalentIncomeDao() *YounggeeTalentIncomeDao {
  56. return &YounggeeTalentIncomeDao{
  57. Group: "default",
  58. Table: "younggee_talent_income",
  59. Columns: younggeeTalentIncomeColumns,
  60. }
  61. }
  62. // DB retrieves and returns the underlying raw database management object of current DAO.
  63. func (dao *YounggeeTalentIncomeDao) DB() gdb.DB {
  64. return g.DB(dao.Group)
  65. }
  66. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  67. func (dao *YounggeeTalentIncomeDao) Ctx(ctx context.Context) *gdb.Model {
  68. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  69. }
  70. // Transaction wraps the transaction logic using function f.
  71. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  72. // It commits the transaction and returns nil if function f returns nil.
  73. //
  74. // Note that, you should not Commit or Rollback the transaction in function f
  75. // as it is automatically handled by this function.
  76. func (dao *YounggeeTalentIncomeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  77. return dao.Ctx(ctx).Transaction(ctx, f)
  78. }