From 3e2ccf0d0ba9b98325916f4df512f1f9ccbb8e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 13 Feb 2023 17:51:52 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/sku.go | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index b2b865f9a..b7f258cf9 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1089,20 +1089,8 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf // 判断是否改价 nowPrice, _ := payload["price"].(json.Number).Int64() if skuName.Price != int(nowPrice) && nowPrice != 0 { - i := payload["skus"].([]struct { - Id int `json:"id"` - SpecQuality int `json:"specQuality"` - SpecUnit string `json:"specUnit"` - Weight int `json:"weight"` - Status string `json:"status"` - Comment string `json:"comment"` - MinOrderCount int `json:"minOrderCount"` - LadderBoxNum int `json:"ladderBoxNum"` - LadderBoxPrice int `json:"ladderBoxPrice"` - EclpID string `json:"eclpID"` - CategoryID []interface{} `json:"categoryID"` - ExdSkuID string `json:"exdSkuID"` - }) + + i := payload["skus"].([]aa) for _, v := range i { var skuPrice int64 = 0 if payload["unit"] == "份" { // 商品规格等于份的时候,标准重量保持为500g @@ -1145,6 +1133,21 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf return num, err } +type aa struct { + Id int `json:"id"` + SpecQuality int `json:"specQuality"` + SpecUnit string `json:"specUnit"` + Weight int `json:"weight"` + Status string `json:"status"` + Comment string `json:"comment"` + MinOrderCount int `json:"minOrderCount"` + LadderBoxNum int `json:"ladderBoxNum"` + LadderBoxPrice int `json:"ladderBoxPrice"` + EclpID string `json:"eclpID"` + CategoryID []interface{} `json:"categoryID"` + ExdSkuID string `json:"exdSkuID"` +} + func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, nameID int, payload map[string]interface{}, skuNameExt *model.SkuNameExt, isDelete bool) (flag bool) { if isDelete { skuVendorCatMaps, _ := dao.GetSkuVendorCategoryMaps(db, []int{nameID}, nil, nil)