Merge remote-tracking branch 'origin/mark' into yonghui

This commit is contained in:
苏尹岚
2019-12-25 11:44:25 +08:00
3 changed files with 21 additions and 9 deletions

View File

@@ -791,8 +791,10 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
valid = utils.RemoveGeneralMapKeys(valid, model.FieldSpecQuality, model.FieldSpecUnit)
_, hasPlaces := payload["places"]
if len(valid) > 0 || hasPlaces {
if upc, _ := valid["Upc"].(string); upc == "" {
valid["Upc"] = nil
if valid["Upc"] != nil {
if upc, _ := valid["Upc"].(string); upc == "" {
valid["Upc"] = nil
}
}
globals.SugarLogger.Debugf("UpdateSkuName valid:%s", utils.Format4Output(valid, false))
// if upc, _ := valid["Upc"].(string); upc != "" {

View File

@@ -1133,12 +1133,13 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
return skuIDs, err
}
func getSkuSaleStatus(inSkuBind *StoreSkuBindSkuInfo, skuBindInfo *StoreSkuBindInfo) int {
func getSkuSaleStatus(inSkuBind *StoreSkuBindSkuInfo, skuNameBindInfo *StoreSkuBindInfo) int {
tempSale := 0
if inSkuBind != nil {
tempSale = inSkuBind.IsSale
} else {
tempSale = skuBindInfo.IsSale
}
if tempSale == 0 {
tempSale = skuNameBindInfo.IsSale
}
if tempSale == -1 {
return model.StoreSkuBindStatusDontSale