orders.gen.go 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. "time"
  7. )
  8. const TableNameOrder = "orders"
  9. // Order mapped from table <orders>
  10. type Order struct {
  11. ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true" json:"id"`
  12. Platform int32 `gorm:"column:platform;type:smallint(6);not null;default:1" json:"platform"` // 订单平台(1:安卓,2:苹果)
  13. RelatID int32 `gorm:"column:relat_id;type:int(11);not null;uniqueIndex:relat_id,priority:1" json:"relat_id"` // 关联订单ID
  14. PaymentType int32 `gorm:"column:payment_type;type:smallint(6);not null;default:1" json:"payment_type"` // 支付方式(1:微信,2抖音 其他待定)
  15. PlayerID int64 `gorm:"column:player_id;type:bigint(20);not null;index:player_id,priority:1;uniqueIndex:relat_id,priority:2" json:"player_id"` // 玩家ID
  16. ServerID int32 `gorm:"column:server_id;type:int(11);not null;index:server_id,priority:1;default:1" json:"server_id"` // 服务器ID
  17. GoodsID int32 `gorm:"column:goods_id;type:int(11);not null" json:"goods_id"` // 商品ID
  18. OrderSn string `gorm:"column:order_sn;type:varchar(255);not null" json:"order_sn"` // 订单号
  19. OutTradeNo string `gorm:"column:out_trade_no;type:varchar(255)" json:"out_trade_no"` // 外部订单号
  20. Money float64 `gorm:"column:money;type:decimal(10,2);not null" json:"money"` // 订单实付金额
  21. IsNew int32 `gorm:"column:is_new;type:smallint(6);not null" json:"is_new"` // 是否为首次下单
  22. Status int32 `gorm:"column:status;type:int(11);not null" json:"status"` // 订单状态
  23. Date string `gorm:"column:date;type:date;not null;index:date,priority:1" json:"date"` // 订单日期
  24. PayAt time.Time `gorm:"column:pay_at;type:datetime" json:"pay_at"` // 支付时间
  25. CreatedAt time.Time `gorm:"column:created_at;type:datetime" json:"created_at"` // 创建时间
  26. ChannelID string `gorm:"column:channel_id;type:varchar(128);index:channel_id,priority:1;default:0" json:"channel_id"` // 渠道ID
  27. UserCreatedAt int32 `gorm:"column:user_created_at;type:int(11);index:user_created_at,priority:1" json:"user_created_at"` // 用户注册时间
  28. Flag int32 `gorm:"column:flag;type:int(11)" json:"flag"`
  29. }
  30. // TableName Order's table name
  31. func (*Order) TableName() string {
  32. return TableNameOrder
  33. }