mysql

package
v0.0.0-...-097943f Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDB

func CreateDB(db *sql.DB, createDB string) error

CreateDB -

func CreateTable

func CreateTable(db *sql.DB, ostore string) error

CreateTable -

func Insert

func Insert(order Order, items []Item, db *sql.DB, closedInterval int, orderDB string, orderTable string, itemTable string) (id uint32, err error)

Insert -

func OrderIDByOrderCode

func OrderIDByOrderCode(db *sql.DB, ostore string, ordercode string) (uint32, error)

OrderIDByOrderCode -

Types

type Item

type Item struct {
	ProductId uint32 `json:"productid"`
	OrderID   uint32 `json:"orderid"`
	Count     uint32 `json:"count"`
	Price     uint32 `json:"price"`
	Discount  uint32 `json:"discount"`
}

func LisitItemByOrderId

func LisitItemByOrderId(db *sql.DB, query string, orderid uint32) ([]*Item, error)

type Order

type Order struct {
	ID         uint32
	OrderCode  string    `json:"ordercode"`
	UserID     uint64    `json:"userid"`
	ShipCode   string    `json:"shipcode"`
	AddressID  string    `json:"addressid"`
	TotalPrice uint32    `json:"totalprice"`
	PayWay     uint8     `json:"payway"`
	Promotion  bool      `json:"promotion"`
	Freight    uint32    `json:"freight"`
	Status     uint8     `json:"status"`
	Created    time.Time `json:"created"`
	Closed     time.Time `json:"closed"`
	Updated    time.Time `json:"updated"`
}

type OrmOrder

type OrmOrder struct {
	*Order
	Orm []*Item
}

func LisitOrderByUserID

func LisitOrderByUserID(db *sql.DB, ostore, istore string, userid uint64, mode uint8) ([]*OrmOrder, error)

func SelectByOrderKey

func SelectByOrderKey(db *sql.DB, ostore, istore string, orderid uint32) (*OrmOrder, error)

Jump to

Keyboard shortcuts

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