x_shop_orders.gen.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Code generated by gorm.io/gen. DO NOT EDIT.
  2. // Code generated by gorm.io/gen. DO NOT EDIT.
  3. // Code generated by gorm.io/gen. DO NOT EDIT.
  4. package model
  5. import (
  6. "github.com/shopspring/decimal"
  7. "go_zh/config"
  8. "time"
  9. )
  10. const TableNameXShopOrder = "x_shop_orders"
  11. // XShopOrder mapped from table <x_shop_orders>
  12. type XShopOrder struct {
  13. ID int `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
  14. ShopID int `gorm:"column:shop_id;not null;comment:店铺ID" json:"shop_id"` // 店铺ID
  15. MID int `gorm:"column:m_id;not null;comment:会员ID" json:"m_id"` // 会员ID
  16. RsSn string `gorm:"column:rs_sn;not null;comment:店铺订单支付编号" json:"rs_sn"` // 店铺订单支付编号
  17. PaySn string `gorm:"column:pay_sn;not null;comment:支付编号" json:"pay_sn"` // 支付编号
  18. PayType int `gorm:"column:pay_type;not null;comment:支付类型,1:微信,2:支付宝" json:"pay_type"` // 支付类型,1:微信,2:支付宝
  19. PayMoney decimal.Decimal `gorm:"column:pay_money;not null;comment:支付金额" json:"pay_money"` // 支付金额
  20. Status int `gorm:"column:status;not null;comment:1:待支付,2:已支付,3:已退款,已完成" json:"status"` // 1:待支付,2:已支付,3:已退款,已完成
  21. CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
  22. UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
  23. Discount decimal.Decimal `gorm:"column:discount;default:0.00;comment:折扣金额" json:"discount"` // 折扣金额
  24. IsClearing int `gorm:"column:is_clearing;comment:是否清分 0:待清分,1:已清分" json:"is_clearing"` // 是否清分 0:待清分,1:已清分
  25. ServiceMoney decimal.Decimal `gorm:"column:service_money;not null;default:0.00;comment:平台手续费" json:"service_money"` // 平台手续费
  26. DiscountMoney decimal.Decimal `gorm:"column:discount_money;not null;default:0.00;comment:让利金额" json:"discount_money"` // 让利金额
  27. EarningsMoney decimal.Decimal `gorm:"column:earnings_money;not null;default:0.00;comment:收益金额" json:"earnings_money"` // 收益金额
  28. ReturnSn string `gorm:"column:return_sn;comment:退款订单编号" json:"return_sn"` // 退款订单编号
  29. IsReport int `gorm:"column:is_report;comment:是否播报" json:"is_report"` // 是否播报
  30. PayCodeSource int `gorm:"column:pay_code_source;default:1;comment:支付收款码来源 1普通收款码 2烟草收款码" json:"pay_code_source"` // 支付收款码来源 1普通收款码 2烟草收款码
  31. IsBank int `gorm:"column:is_bank;comment:是否银联支付 0否1是" json:"is_bank"` // 是否银联支付 0否1是
  32. }
  33. // TableName XShopOrder's table name
  34. func (*XShopOrder) TableName() string {
  35. return TableNameXShopOrder
  36. }
  37. //新增订单
  38. func (so *XShopOrder) CreateShopOrder() error {
  39. err := config.Mdb.Model(&so).Create(&so).Error
  40. return err
  41. }