order_delivery_info.go 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. // OrderDeliveryInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type OrderDeliveryInfoDao 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 OrderDeliveryInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // OrderDeliveryInfoColumns defines and stores column names for table order_delivery_info.
  17. type OrderDeliveryInfoColumns struct {
  18. OrderDeliveryId string // 执行补充信息
  19. OrderId string // 订单id
  20. OrderAddressee string // 收货人
  21. OrderPhone string // 订单所填手机号
  22. RegionCode string // 区域码
  23. OrderAddress string // 订单地址
  24. LogisticsCompany string // 物流公司
  25. TrackingNum string // 物流单号
  26. CreatedAt string // 创建时间
  27. ConfirmTime string // 确认收获时间
  28. DeliveryTime string // 发货时间
  29. DeliveryStatus string // 发货状态 1是未发货,2是已发货 3已收货
  30. }
  31. // orderDeliveryInfoColumns holds the columns for table order_delivery_info.
  32. var orderDeliveryInfoColumns = OrderDeliveryInfoColumns{
  33. OrderDeliveryId: "order_delivery_id",
  34. OrderId: "order_id",
  35. OrderAddressee: "order_addressee",
  36. OrderPhone: "order_phone",
  37. RegionCode: "region_code",
  38. OrderAddress: "order_address",
  39. LogisticsCompany: "logistics_company",
  40. TrackingNum: "tracking_num",
  41. CreatedAt: "created_at",
  42. ConfirmTime: "confirm_time",
  43. DeliveryTime: "delivery_time",
  44. DeliveryStatus: "delivery_status",
  45. }
  46. // NewOrderDeliveryInfoDao creates and returns a new DAO object for table data access.
  47. func NewOrderDeliveryInfoDao() *OrderDeliveryInfoDao {
  48. return &OrderDeliveryInfoDao{
  49. Group: "default",
  50. Table: "order_delivery_info",
  51. Columns: orderDeliveryInfoColumns,
  52. }
  53. }
  54. // DB retrieves and returns the underlying raw database management object of current DAO.
  55. func (dao *OrderDeliveryInfoDao) DB() gdb.DB {
  56. return g.DB(dao.Group)
  57. }
  58. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  59. func (dao *OrderDeliveryInfoDao) Ctx(ctx context.Context) *gdb.Model {
  60. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  61. }
  62. // Transaction wraps the transaction logic using function f.
  63. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  64. // It commits the transaction and returns nil if function f returns nil.
  65. //
  66. // Note that, you should not Commit or Rollback the transaction in function f
  67. // as it is automatically handled by this function.
  68. func (dao *OrderDeliveryInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  69. return dao.Ctx(ctx).Transaction(ctx, f)
  70. }