package entity import "gopkg.in/guregu/null.v3" type Product struct { Id int `db:"id" json:"id"` No string `db:"no" json:"no"` Name string `db:"name" json: "name"` MarketPrice int `db:"market_price" json:"market_price"` Price int `db:"price" json:"price"` IsPutAway int `db:"is_putaway"` IsRecommend int `db:"is_recommend"` Tips string `db:"tips"` Tags string `db:"tags"` Picture string `db:"picture"` CreatedAt string `db:"created_at"` UpdatedAt string `db:"updated_at"` Tube string `db:"tube"` SaleMode int `db:"sale_mode"` Collection string `db:"collection"` Notice string `db:"notice"` Report string `db:"report"` IsDrawBlood int `db:"is_draw_blood"` Sampling string `db:"sampling"` TipReportDays int `db:"tip_report_days"` DpidStr string `db:"dpid_str"` } type ProductDB struct { Id int `db:"id" json:"id"` No null.String `db:"no" json:"no"` Name string `db:"name" json:"name"` Price int `db:"price" json:"price"` MarketPrice int `db:"market_price" json:"market_price"` IsPutAway int `db:"is_putaway" json:"isPutaway"` IsRecomment int `db:"is_recommend" json:"isRecommend"` Tips null.String `db:"tips" json:"tips"` Tags null.String `db:"tags" json:"tags"` Picture string `db:"picture"` CreatedAt string `db:"created_at" json:"createdAt"` UpdatedAt string `db:"updated_at" json:"updatedAt"` Items []DetectProduct `db:"-" json:"items"` Pictures []ProductPicture `db:"-" json:"pictures"` Attributes interface{} `db:"-" json:"attributes"` CityIds null.String `db:"cityIds" json:"CityIds"` CountyIds null.String `db:"countyIds" json:"CountyIds"` Citys []City `db:"-" json:"citys"` Tube null.String `db:"tube"` SaleMode int `db:"sale_mode"` Collection string `db:"collection" json:"collection"` Notice string `db:"notice" json:"notice"` Report string `db:"report" json:"report"` InstructionsTitle string `db:"instructionstitle" json:"instructionstitle"` Instructions string `db:"instructions" json:"instructions"` IsNoBooktime int `db:"is_no_booktime" json:"is_no_booktime"` IsDrawBlood int `db:"is_draw_blood" json:"is_draw_blood"` IsWorkFee int `db:"is_work_fee" json:"is_work_fee"` IsTip null.Int `db:"is_tip" json:"is_tip"` TipContent null.String `db:"tip_content" json:"tip_content"` Quantity int `db:"quantity" json:"quantity"` Sampling null.String `db:"sampling" json:"sampling"` IsJiyin null.Int `db:"is_jiyin" json:"is_jiyin"` Stock int `db:"stock" json:"stock"` StockSwitch string `db:"stock_switch" json:"stock_switch"` Pstock int `db:"pstock" json:"pstock"` PstockSwitch string `db:"pstock_switch" json:"pstock_switch"` BoughtNum null.Int `db:"bought_num" json:"-"` Searchs string `db:"searchs" json:"searchs"` TopNum int `db:"num" json:"top_num"` IsEmptyStomach int `db:"is_empty_stomach" json:"is_empty_stomach"` ZFBStock int `db:"zfb_stock" json:"-"` ZFBPStock int `db:"zfb_pstock" json:"-"` ZFBPrice int `db:"zfb_price" json:"-"` IsZFB int `db:"is_zfb" json:"-"` } func ZFBWash(l []*ProductDB) { for k := range l { l[k].Stock = l[k].ZFBStock l[k].Pstock = l[k].ZFBPStock l[k].Price = l[k].ZFBPrice } } /*type PicturePath struct { sql.NullString } func (s PicturePath) MarshalJSON() ([]byte, error) { if !s.Valid { return []byte("null"), nil } return json.Marshal(util.EncryptPath([]byte(s.String), []byte(util.PATH_SECRET))) }*/