1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- // ==========================================================================
- // 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"
- )
- // InfoPricingStrategyDao is the manager for logic model data accessing and custom defined data operations functions management.
- type InfoPricingStrategyDao 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 InfoPricingStrategyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
- }
- // InfoPricingStrategyColumns defines and stores column names for table info_pricing_strategy.
- type InfoPricingStrategyColumns struct {
- Id string // id
- ProjectType string // 项目类型,0表示不限,1为全流程项目
- StrategyId string // 定价策略编号
- FeeForm string // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
- Platform string // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
- FansLow string // 对应粉丝量下限
- FansUp string // 对应粉丝量上限
- ServiceCharge string // 服务费,稿费形式为产品置换时填写,可以为空
- BaseOffer string // 基础报价
- Status string // 定价策略当前状态,0表示正常,1表示禁用
- ServiceRate string // 服务费率*1000,稿费形式为固定稿费和自报价时填写,可以为空
- UpdateId string // 修改管理人员id,对应user表中主键
- UpdateAt string // 修改时间
- CreateAt string // 创建时间
- }
- // infoPricingStrategyColumns holds the columns for table info_pricing_strategy.
- var infoPricingStrategyColumns = InfoPricingStrategyColumns{
- Id: "id",
- ProjectType: "project_type",
- StrategyId: "strategyId",
- FeeForm: "fee_form",
- Platform: "platform",
- FansLow: "fans_low",
- FansUp: "fans_up",
- ServiceCharge: "service_charge",
- BaseOffer: "base_offer",
- Status: "status",
- ServiceRate: "service_rate",
- UpdateId: "update_id",
- UpdateAt: "update_at",
- CreateAt: "create_at",
- }
- // NewInfoPricingStrategyDao creates and returns a new DAO object for table data access.
- func NewInfoPricingStrategyDao() *InfoPricingStrategyDao {
- return &InfoPricingStrategyDao{
- Group: "default",
- Table: "info_pricing_strategy",
- Columns: infoPricingStrategyColumns,
- }
- }
- // DB retrieves and returns the underlying raw database management object of current DAO.
- func (dao *InfoPricingStrategyDao) 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 *InfoPricingStrategyDao) 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 *InfoPricingStrategyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
- return dao.Ctx(ctx).Transaction(ctx, f)
- }
|