From 2336ad2ba4736b786442c7b0a0cbfe0001fe2889 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 1 Nov 2018 23:31:46 +0800 Subject: [PATCH] - fix bug in CopyStoreSkus from and to are same, and specified category --- business/jxstore/cms/store_sku.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index c257c8c23..d0fd3dd1d 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -494,6 +494,9 @@ func CopyStoreSkus(ctx *jxcontext.Context, fromStoreID, toStoreID int, copyMode // return 0, fmt.Errorf("源门店:%d与目标门店:%d相同", fromStoreID, toStoreID) sql := ` UPDATE store_sku_bind t1 + JOIN sku t2 ON t1.sku_id = t2.id AND t2.deleted_at = ? + JOIN sku_name t3 ON t2.name_id = t3.id AND t2.deleted_at = ? + JOIN sku_category t4 ON t3.category_id = t4.id AND t2.deleted_at = ? SET t1.last_operator = ?, t1.updated_at = ?, t1.price = t1.price * ? / 100, @@ -504,6 +507,9 @@ func CopyStoreSkus(ctx *jxcontext.Context, fromStoreID, toStoreID int, copyMode WHERE t1.store_id = ? AND t1.deleted_at = ? ` sqlParams := []interface{}{ + utils.DefaultTimeValue, + utils.DefaultTimeValue, + utils.DefaultTimeValue, userName, now, pricePercentage,