diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 054864a2d..9e5dd87d9 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -25,6 +25,8 @@ import ( ) const ( + MaxSkuUnitPrice = 100000 + CopyStoreSkuModeFresh = "fresh" CopyStoreSkuModeUpdate = "update" // CopyStoreSkuModeAdd = "add" @@ -71,6 +73,7 @@ type StoreSkuBindInfo struct { type tStoreSkuBindAndSpec struct { model.StoreSkuBind + Name string SpecQuality float32 SpecUnit string SkuNamePrice int @@ -580,7 +583,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind SELECT t2.*, t1.id real_sku_id, t1.spec_quality, t1.spec_unit, - t3.price sku_name_price, t3.unit sku_name_unit + t3.price sku_name_price, t3.unit sku_name_unit, t3.name 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 = ? @@ -604,6 +607,10 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind } unitPrice := 0 if skuBindInfo.UnitPrice != 0 { + if skuBindInfo.UnitPrice > MaxSkuUnitPrice { + dao.Rollback(db) + return nil, fmt.Errorf("商品:%s价格:%s太夸张", allBinds[0].Name, jxutils.IntPrice2StandardCurrencyString(int64(skuBindInfo.UnitPrice))) + } unitPrice = skuBindInfo.UnitPrice } else { unitPrice = allBinds[0].UnitPrice