info_pricing_strategy.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. // InfoPricingStrategyDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type InfoPricingStrategyDao 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 InfoPricingStrategyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // InfoPricingStrategyColumns defines and stores column names for table info_pricing_strategy.
  17. type InfoPricingStrategyColumns struct {
  18. Id string // id
  19. FeeForm string // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
  20. Platform string // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
  21. FansLow string // 对应粉丝量下限
  22. FansUp string // 对应粉丝量上限
  23. ServiceCharge string // 服务费,稿费形式为产品置换时填写,可以为空
  24. ServiceRate string // 服务费率*1000,稿费形式为固定稿费和自报价时填写,可以为空
  25. UpdateId string // 修改管理人员id,对应user表中主键
  26. UpdateAt string // 修改时间
  27. CreateAt string // 创建时间
  28. }
  29. // infoPricingStrategyColumns holds the columns for table info_pricing_strategy.
  30. var infoPricingStrategyColumns = InfoPricingStrategyColumns{
  31. Id: "id",
  32. FeeForm: "fee_form",
  33. Platform: "platform",
  34. FansLow: "fans_low",
  35. FansUp: "fans_up",
  36. ServiceCharge: "service_charge",
  37. ServiceRate: "service_rate",
  38. UpdateId: "update_id",
  39. UpdateAt: "update_at",
  40. CreateAt: "create_at",
  41. }
  42. // NewInfoPricingStrategyDao creates and returns a new DAO object for table data access.
  43. func NewInfoPricingStrategyDao() *InfoPricingStrategyDao {
  44. return &InfoPricingStrategyDao{
  45. Group: "default",
  46. Table: "info_pricing_strategy",
  47. Columns: infoPricingStrategyColumns,
  48. }
  49. }
  50. // DB retrieves and returns the underlying raw database management object of current DAO.
  51. func (dao *InfoPricingStrategyDao) DB() gdb.DB {
  52. return g.DB(dao.Group)
  53. }
  54. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  55. func (dao *InfoPricingStrategyDao) Ctx(ctx context.Context) *gdb.Model {
  56. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  57. }
  58. // Transaction wraps the transaction logic using function f.
  59. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  60. // It commits the transaction and returns nil if function f returns nil.
  61. //
  62. // Note that, you should not Commit or Rollback the transaction in function f
  63. // as it is automatically handled by this function.
  64. func (dao *InfoPricingStrategyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  65. return dao.Ctx(ctx).Transaction(ctx, f)
  66. }