// ========================================================================== // 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" ) // YoungeeTaskPayDao is the manager for logic model data accessing and custom defined data operations functions management. type YoungeeTaskPayDao 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 YoungeeTaskPayColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. } // YoungeeTaskPayColumns defines and stores column names for table youngee_task_pay. type YoungeeTaskPayColumns struct { Id string // id TaskId string // 任务id AllReward string // 达人报酬 RealReward string // 达人实际所得(扣除违约扣款) AllPayment string // 企业支付 RealPayment string // 企业实际支付(扣除违约扣款) Penalty string // 违约扣款比例,百分之 FeeForm string // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价 ServiceCharge string // 服务费 ServiceRate string // 服务费率 UpdateAt string // 更新时间 } // youngeeTaskPayColumns holds the columns for table youngee_task_pay. var youngeeTaskPayColumns = YoungeeTaskPayColumns{ Id: "id", TaskId: "task_id", AllReward: "all_reward", RealReward: "real_reward", AllPayment: "all_payment", RealPayment: "real_payment", Penalty: "penalty", FeeForm: "fee_form", ServiceCharge: "service_charge", ServiceRate: "service_rate", UpdateAt: "update_at", } // NewYoungeeTaskPayDao creates and returns a new DAO object for table data access. func NewYoungeeTaskPayDao() *YoungeeTaskPayDao { return &YoungeeTaskPayDao{ Group: "default", Table: "youngee_task_pay", Columns: youngeeTaskPayColumns, } } // DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YoungeeTaskPayDao) 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 *YoungeeTaskPayDao) 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 *YoungeeTaskPayDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) }