- 限制门店价格最大值为1000元
This commit is contained in:
@@ -25,6 +25,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
MaxSkuUnitPrice = 100000
|
||||||
|
|
||||||
CopyStoreSkuModeFresh = "fresh"
|
CopyStoreSkuModeFresh = "fresh"
|
||||||
CopyStoreSkuModeUpdate = "update"
|
CopyStoreSkuModeUpdate = "update"
|
||||||
// CopyStoreSkuModeAdd = "add"
|
// CopyStoreSkuModeAdd = "add"
|
||||||
@@ -71,6 +73,7 @@ type StoreSkuBindInfo struct {
|
|||||||
|
|
||||||
type tStoreSkuBindAndSpec struct {
|
type tStoreSkuBindAndSpec struct {
|
||||||
model.StoreSkuBind
|
model.StoreSkuBind
|
||||||
|
Name string
|
||||||
SpecQuality float32
|
SpecQuality float32
|
||||||
SpecUnit string
|
SpecUnit string
|
||||||
SkuNamePrice int
|
SkuNamePrice int
|
||||||
@@ -580,7 +583,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
|
|||||||
SELECT
|
SELECT
|
||||||
t2.*,
|
t2.*,
|
||||||
t1.id real_sku_id, t1.spec_quality, t1.spec_unit,
|
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
|
FROM sku t1
|
||||||
JOIN store ts ON ts.id = ? AND ts.deleted_at = ?
|
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 = ?
|
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
|
unitPrice := 0
|
||||||
if skuBindInfo.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
|
unitPrice = skuBindInfo.UnitPrice
|
||||||
} else {
|
} else {
|
||||||
unitPrice = allBinds[0].UnitPrice
|
unitPrice = allBinds[0].UnitPrice
|
||||||
|
|||||||
Reference in New Issue
Block a user