package internal import ( "context" "github.com/gogf/gf/database/gdb" "github.com/gogf/gf/frame/g" ) // YounggeeSecTaskInfoDao is the manager for logic model data accessing and custom defined data operations functions management. type YounggeeSecTaskInfoDao 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 YounggeeSecTaskInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. } // YounggeeSecTaskInfoColumns defines and stores column names for table younggee_sec_task_info. type YounggeeSecTaskInfoColumns struct { Id string // 递增id TaskId string // 选品任务id SelectionId string // 选品id TalentId string // 达人id AccountId string // 账号id TalentPlatformInfoSnap string // 达人平台信息快照 TalentPersonalInfoSnap string // 达人个人信息快照 TalentPostAddrSnap string // 收货地址快照 TaskReward string // 达人赏金 TalentPayment string // 达人垫付金额 IsPayPayment string // 企业是否返样品钱 IsPayReward string // 企业是否结算悬赏 TaskMode string // 任务形式,1、2分别表示纯佣带货、悬赏任务 SampleMode string // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品 TaskStatus string // 任务状态 1待选 2已选 3落选 TaskStage string // 任务阶段,详情见info_sec_task_stage表 CreateDate string // 创建时间 SelectDate string // 反选时间 DeliveryDate string // 发货时间 CompleteDate string // 结束时间 WithdrawDate string // 提现时间 CompleteStatus string // 结束方式 1未结束 2正常结束 3反选失败 LogisticsStatus string // 发货状态 1 待发货 2已发货 3 已签收 AssignmentStatus string // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过 RewardStage int UpdateAt string // 更新时间 WithdrawStatus string // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现 LeadTeamId string // 作为团长的young之团id,对应younggee_talent_team中的team_id字段 TeamId string // 作为团员的young之团id,对应younggee_talent_team中的team_id字段 TeamIncome string // young之团团长现金收益 TeamPoint string // young之团团长积分收益 ProductId string //商品id } // younggeeSecTaskInfoColumns holds the columns for table younggee_sec_task_info. var younggeeSecTaskInfoColumns = YounggeeSecTaskInfoColumns{ Id: "id", TaskId: "task_id", SelectionId: "selection_id", ProductId: "product_id", TalentId: "talent_id", AccountId: "account_id", TalentPlatformInfoSnap: "talent_platform_info_snap", TalentPersonalInfoSnap: "talent_personal_info_snap", TalentPostAddrSnap: "talent_post_addr_snap", TaskReward: "task_reward", TalentPayment: "talent_payment", IsPayPayment: "is_pay_payment", IsPayReward: "is_pay_reward", TaskMode: "task_mode", SampleMode: "sample_mode", TaskStatus: "task_status", TaskStage: "task_stage", CreateDate: "create_date", SelectDate: "select_date", DeliveryDate: "delivery_date", CompleteDate: "complete_date", WithdrawDate: "withdraw_date", CompleteStatus: "complete_status", LogisticsStatus: "logistics_status", AssignmentStatus: "assignment_status", UpdateAt: "update_at", WithdrawStatus: "withdraw_status", LeadTeamId: "lead_team_id", TeamId: "team_id", TeamIncome: "team_income", TeamPoint: "team_point", } // NewYounggeeSecTaskInfoDao creates and returns a new DAO object for table data access. func NewYounggeeSecTaskInfoDao() *YounggeeSecTaskInfoDao { return &YounggeeSecTaskInfoDao{ Group: "default", Table: "younggee_sec_task_info", Columns: younggeeSecTaskInfoColumns, } } // DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YounggeeSecTaskInfoDao) 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 *YounggeeSecTaskInfoDao) 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 *YounggeeSecTaskInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) }