This commit is contained in:
gazebo
2018-09-25 18:29:11 +08:00
parent b1c341449a
commit b7ad5004b6
4 changed files with 69 additions and 15 deletions

View File

@@ -10,9 +10,12 @@ const (
SkuStatusOffline = 0
)
const (
UPCTypeStandard = 1
UPCTypePrivate = 0
)
const (
MaxLeftNum = 9999
DefUPC = 12345678
)
type CategoryInfo struct {
@@ -109,13 +112,17 @@ func (a *API) SkuList(shopID string, params map[string]interface{}) (skuInfo *Pa
return nil, err
}
func (a *API) SkuCreate(shopID string, params map[string]interface{}) (skuID int64, err error) {
func (a *API) SkuCreate(shopID string, customSkuID int, params map[string]interface{}) (skuID int64, err error) {
defParams := map[string]interface{}{
KeyShopID: shopID,
}
if params["upc"] == nil {
defParams["upc"] = DefUPC
KeyShopID: shopID,
"custom_sku_id": customSkuID,
"upc_type": UPCTypePrivate,
"upc": customSkuID,
"brand_name": "京西菜市",
}
// if params["upc"] == nil {
// defParams["upc"] = "upc-" + utils.Int2Str(customSkuID)
// }
if params["brand_id"] == nil {
defParams["brand_id"] = 0
}