model

package
v0.0.0-...-99ed3b9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWithOrderId

func GetWithOrderId(orderId string) func(db *gorm.DB) *gorm.DB

Types

type Order

type Order struct {
	Id           int64       `gorm:"column:id" json:"id"`
	OrderId      string      `gorm:"column:order_id" json:"orderId"`
	UserId       int64       `gorm:"column:user_id" json:"userId"`
	UserName     string      `gorm:"column:user_name" json:"userName"`
	UserPhone    string      `gorm:"column:user_phone" json:"userPhone"`
	UserAddress  string      `gorm:"column:user_address" json:"userAddress"`
	TotalAmount  int64       `gorm:"column:total_amount" json:"totalAmount"`
	Remark       string      `gorm:"column:remark" json:"remark"`
	PaidAt       int64       `gorm:"column:paid_at" json:"paidAt"`
	PaymentNo    string      `gorm:"column:payment_no" json:"paymentNo"`
	RefundStatus string      `gorm:"column:refund_status" json:"refundStatus"`
	RefundNo     string      `gorm:"column:refund_no" json:"refundNo"`
	OrderStatus  OrderState  `gorm:"column:order_status" json:"OrderStatus"`
	Extra        string      `gorm:"column:extra" json:"extra"`
	CreatedAt    int64       `gorm:"column:created_at;autoCreatedAt" json:"createdAt"`
	UpdatedAt    int64       `gorm:"column:updated_at;autoUpdatedAt" json:"updatedAt"`
	OrderItems   []OrderItem `gorm:"foreignKey:OrderId;references:OrderId"`
}

func (*Order) BeforeCreate

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

func (Order) TableName

func (Order) TableName() string

type OrderItem

type OrderItem struct {
	Id           int64  `gorm:"column:id" json:"id"`
	OrderId      int64  `gorm:"column:order_id" json:"orderId"`
	ProductId    int64  `gorm:"column:product_id" json:"productId"`
	ProductSkuId int64  `gorm:"column:product_sku_id" json:"productSkuId"`
	Amount       int64  `gorm:"column:amount" json:"amount"`
	Price        int64  `gorm:"column:price" json:"price"`
	Title        string `gorm:"column:title" json:"title"`
	Image        string `gorm:"column:image" json:"image"`
}

func (OrderItem) TableName

func (OrderItem) TableName() string

type OrderState

type OrderState int16
const (
	WaitPay     OrderState = iota + 1 //待付款
	WaitDeliver                       //待发货
	ForGood                           //待收货
	Cancel      = 10                  // 已取消
)

Jump to

Keyboard shortcuts

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