youngee_task_pay.go 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. // YoungeeTaskPayDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YoungeeTaskPayDao 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 YoungeeTaskPayColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YoungeeTaskPayColumns defines and stores column names for table youngee_task_pay.
  17. type YoungeeTaskPayColumns struct {
  18. Id string // id
  19. TaskId string // 任务id
  20. AllReward string // 达人报酬
  21. RealReward string // 达人实际所得(扣除违约扣款)
  22. AllPayment string // 企业支付
  23. RealPayment string // 企业实际支付(扣除违约扣款)
  24. Penalty string // 违约扣款比例,百分之
  25. FeeForm string // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
  26. ServiceCharge string // 服务费
  27. ServiceRate string // 服务费率
  28. UpdateAt string // 更新时间
  29. }
  30. // youngeeTaskPayColumns holds the columns for table youngee_task_pay.
  31. var youngeeTaskPayColumns = YoungeeTaskPayColumns{
  32. Id: "id",
  33. TaskId: "task_id",
  34. AllReward: "all_reward",
  35. RealReward: "real_reward",
  36. AllPayment: "all_payment",
  37. RealPayment: "real_payment",
  38. Penalty: "penalty",
  39. FeeForm: "fee_form",
  40. ServiceCharge: "service_charge",
  41. ServiceRate: "service_rate",
  42. UpdateAt: "update_at",
  43. }
  44. // NewYoungeeTaskPayDao creates and returns a new DAO object for table data access.
  45. func NewYoungeeTaskPayDao() *YoungeeTaskPayDao {
  46. return &YoungeeTaskPayDao{
  47. Group: "default",
  48. Table: "youngee_task_pay",
  49. Columns: youngeeTaskPayColumns,
  50. }
  51. }
  52. // DB retrieves and returns the underlying raw database management object of current DAO.
  53. func (dao *YoungeeTaskPayDao) DB() gdb.DB {
  54. return g.DB(dao.Group)
  55. }
  56. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  57. func (dao *YoungeeTaskPayDao) Ctx(ctx context.Context) *gdb.Model {
  58. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  59. }
  60. // Transaction wraps the transaction logic using function f.
  61. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  62. // It commits the transaction and returns nil if function f returns nil.
  63. //
  64. // Note that, you should not Commit or Rollback the transaction in function f
  65. // as it is automatically handled by this function.
  66. func (dao *YoungeeTaskPayDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  67. return dao.Ctx(ctx).Transaction(ctx, f)
  68. }