orders

package
v3.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB)

AutoMigrate 自动同步表结构

Types

type Order

type Order struct {
	models.BaseModel
	UserID        int64                      `gorm:"column:user_id;type:bigint;not null;index:user_id;comment:用户编号"`
	OrderNo       string                     `gorm:"column:order_no;type:varchar(40);not null;index:order_no,unique;comment:订单号"`
	ProductName   string                     `gorm:"column:product_name;type:varchar(255);not null;comment:商品名称"`
	ProductNum    int                        `gorm:"column:product_num;type:int;not null;comment:商品数量"`
	Status        modelsEnum.OrderStatusCode `gorm:"column:status;type:tinyint;not null;default:0;comment:订单状态"`
	Amount        float64                    `gorm:"column:amount;type:decimal(14,4);not null;comment:订单金额"`
	TransactionID string                     `gorm:"column:transaction_id;type:varchar(40);index:bet_transaction_id;comment:交易流水号"`
	Platform      int                        `gorm:"column:platform;type:tinyint;not null;default:0;comment:下单的客户端平台(0:web,1:app)"`
}

func (*Order) BeforeCreate

func (o *Order) BeforeCreate(_ *gorm.DB) (err error)

func (*Order) BeforeUpdate

func (o *Order) BeforeUpdate(_ *gorm.DB) (err error)

func (*Order) Class

func (*Order) Class() string

func (*Order) GenOrderNo

func (*Order) GenOrderNo() string

func (*Order) TableName

func (*Order) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL