mysql

package
v0.0.0-...-4f5c9a4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct {
	// contains filtered or unexported fields
}

MySQL struct

func New

func New(db *sqlx.DB) *MySQL

New init mysql

func (*MySQL) Delete

func (m *MySQL) Delete(ctx context.Context, isAdmin bool, order *entity.Order) (err error)

func (*MySQL) GetByInv

func (m *MySQL) GetByInv(ctx context.Context, app int64, inv string, all bool, isAdmin bool, uid string) (order *entity.Order, err error)

GetByID . . .

func (*MySQL) Insert

func (m *MySQL) Insert(ctx context.Context, order *entity.Order) (err error)

func (*MySQL) Select

func (m *MySQL) Select(ctx context.Context, app int64, all bool, isAdmin bool, uid string) (order entity.Orders, err error)

func (*MySQL) Update

func (m *MySQL) Update(ctx context.Context, isAdmin bool, order *entity.Order) (err error)

type Order

type Order struct {
	ID            int64     `db:"id"`
	InvoiceNum    string    `db:"invoice_num"`
	SaleDate      *string   `db:"sale_date"`
	SaleTime      *string   `db:"sale_time"`
	SubTotal      *float64  `db:"sub_total"`
	Tax           *float64  `db:"tax"`
	Total         *float64  `db:"total"`
	Cash          *float64  `db:"cash"`
	ChangeMoney   *float64  `db:"change_money"`
	Other         *string   `db:"other"`
	PaymentStatus *int8     `db:"payment_status"`
	CustomerID    *int64    `db:"customer_id"`
	EmployeeID    int64     `db:"employee_id"`
	AppID         int64     `db:"app_id"`
	CreatedAt     null.Time `db:"created_at"`
	CreatedBy     string    `db:"created_by"`
	UpdatedAt     null.Time `db:"updated_at"`
	LastUpdateBy  *string   `db:"last_update_by"`
	DeletedAt     null.Time `db:"deleted_at"`
	IsActive      int8      `db:"is_active"`
}

Order struct

type Orders

type Orders []Order

Order list

Jump to

Keyboard shortcuts

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