From 36a505fb32040e953164e5bd7fd1e7b52891a4a7 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 31 Oct 2019 15:49:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E5=BA=93=E4=B8=AD=E5=8F=AF?= =?UTF-8?q?=E5=94=AE=E7=9A=84=E5=95=86=E5=93=81=E6=89=8D=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=85=B3=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index cc69d738d..25d9e9bf1 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -123,12 +123,14 @@ type StoreSkuBindInfo struct { type tStoreSkuBindAndSpec struct { model.StoreSkuBind - Name string - SpecQuality float32 - SpecUnit string - SkuNamePrice int - SkuNameUnit string - RealSkuID int `orm:"column(real_sku_id)"` + SkuStatus int + SkuNameStatus int + Name string + SpecQuality float32 + SpecUnit string + SkuNamePrice int + SkuNameUnit string + RealSkuID int `orm:"column(real_sku_id)"` } type SkuSaleInfo struct { @@ -924,12 +926,12 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs sql := ` SELECT t2.*, - t1.id real_sku_id, t1.spec_quality, t1.spec_unit,` + t1.id real_sku_id, t1.status sku_status, t1.spec_quality, t1.spec_unit,` if needGetExistingUnitPrice { sql += " IF(t5.unit_price > 0, t5.unit_price, t3.price) sku_name_price," } sql += ` - t3.unit sku_name_unit, t3.name + t3.unit sku_name_unit, t3.name, t3.status sku_name_status FROM sku t1 JOIN store ts ON ts.id = ? AND ts.deleted_at = ? LEFT JOIN store_sku_bind t2 ON t2.sku_id = t1.id AND t2.store_id = ts.id AND t2.deleted_at = ? @@ -982,7 +984,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs // globals.SugarLogger.Debug(utils.Format4Output(inSkuBind, false)) var skuBind *model.StoreSkuBind if v.ID == 0 { - if skuBindInfo.IsFocus == 1 { + if skuBindInfo.IsFocus == 1 && v.SkuNameStatus == model.SkuStatusNormal && v.SkuStatus == model.SkuStatusNormal { skuBind = &model.StoreSkuBind{ StoreID: storeID, SkuID: v.RealSkuID,