sku

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateDisable   int64 = -100
	StateUnChecked int64 = 100
	StateIsChecked int64 = 200
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SKU

type SKU struct {
	ID          int64  `gorm:"column:id;type:bigint unsigned NOT NULL;autoIncrement;primaryKey" json:"id"`
	SKU         string `gorm:"column:sku;type:varchar(64) NOT NULL;uniqueIndex:udx_sku" json:"sku"`              //SKU
	Model       string `gorm:"column:model;type:varchar(128) NOT NULL;uniqueIndex:udx_model_brand" json:"model"` //型号
	BrandName   string `gorm:"column:brand_name;type:varchar(128) NOT NULL" json:"brand_name"`                   //品牌
	BrandCode   string `gorm:"column:brand_code;type:varchar(16) NOT NULL;uniqueIndex:udx_model_brand" json:"-"` //品牌CODE
	CateName    string `gorm:"column:cate_name;type:varchar(64) DEFAULT ''" json:"cate_name"`                    //类目
	CateCode    string `gorm:"column:cate_code;type:varchar(16) DEFAULT '';index:idx_cate_code" json:"-"`        //类目CODE
	IMG         string `gorm:"column:img;type:varchar(256) DEFAULT ''" json:"img"`                               //图片
	PDF         string `gorm:"column:pdf;type:varchar(256) DEFAULT ''" json:"pdf"`                               //PDF
	Description string `gorm:"column:description;type:varchar(256) DEFAULT ''" json:"description"`
	State       int64  `gorm:"column:state;type:smallint DEFAULT '100';index:idx_state" json:"state"`                                       //状态
	DeletedAt   int64  `gorm:"column:deleted_at;type:int unsigned NOT NULL DEFAULT '0';index:idx_deleted_at" json:"-"`                      //删除时间
	CreatedAt   string `gorm:"column:created_at;->;type:timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP" json:"-"`                             //更新时间
	UpdatedAt   string `gorm:"column:updated_at;->;type:timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" json:"-"` //更新时间

	Metas string `gorm:"-" json:"metas"`
}

func GetOneByModelBrand added in v0.0.2

func GetOneByModelBrand(md, bc string) (*SKU, error)

func GetOneBySku added in v0.0.2

func GetOneBySku(sku string) (obj *SKU, err error)
func Search(name string) (list []SKU, err error)

func (*SKU) Create added in v0.0.2

func (p *SKU) Create() error

func (*SKU) TableName

func (p *SKU) TableName() string

func (*SKU) Update added in v0.0.2

func (p *SKU) Update(update SKU) error

Jump to

Keyboard shortcuts

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