// ========================================================================== // Code generated by GoFrame CLI tool. DO NOT EDIT. // ========================================================================== package internal import ( "context" "github.com/gogf/gf/database/gdb" "github.com/gogf/gf/frame/g" ) // YounggeeTalentIncomeDao is the manager for logic model data accessing and custom defined data operations functions management. type YounggeeTalentIncomeDao struct { Table string // Table is the underlying table name of the DAO. Group string // Group is the database configuration group name of current DAO. Columns YounggeeTalentIncomeColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. } // YounggeeTalentIncomeColumns defines and stores column names for table younggee_talent_income. type YounggeeTalentIncomeColumns struct { Id string // 递增id TalentId string // 达人id,对应youngee_talent_info中id字段 ProjectId string // 项目id SelectionId string // 选品id TaskId string // 任务id SectaskId string // 选品任务id BrandName string // 品牌名称 TaskName string // 任务名称 TeamId string // young之团id Income string // 收益金额 IncomeType string // 收益类型,1-4分别表示任务收益、开团收益、样品返现、悬赏收益 WithdrawStatus string // 提现状态,1-3分别表示可提现、提现中、已提现 IncomeAt string // 收益产生时间 WithdrawAt string // 提现时间 PhotoUrl string // 商品主图 Type string // 选品or项目,1:项目,2:选品 } // younggeeTalentIncomeColumns holds the columns for table younggee_talent_income. var younggeeTalentIncomeColumns = YounggeeTalentIncomeColumns{ Id: "id", TalentId: "talent_id", ProjectId: "project_id", SelectionId: "selection_id", TaskId: "task_id", SectaskId: "sectask_id", BrandName: "brand_name", TaskName: "task_name", TeamId: "team_id", Income: "income", IncomeType: "income_type", WithdrawStatus: "withdraw_status", IncomeAt: "income_at", WithdrawAt: "withdraw_at", PhotoUrl: "photo_url", Type: "type", } // NewYounggeeTalentIncomeDao creates and returns a new DAO object for table data access. func NewYounggeeTalentIncomeDao() *YounggeeTalentIncomeDao { return &YounggeeTalentIncomeDao{ Group: "default", Table: "younggee_talent_income", Columns: younggeeTalentIncomeColumns, } } // DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YounggeeTalentIncomeDao) DB() gdb.DB { return g.DB(dao.Group) } // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *YounggeeTalentIncomeDao) Ctx(ctx context.Context) *gdb.Model { return dao.DB().Model(dao.Table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. // It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // // Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *YounggeeTalentIncomeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) }