- fix bug in CopyStoreSkus from and to are same, and specified category
This commit is contained in:
@@ -494,6 +494,9 @@ func CopyStoreSkus(ctx *jxcontext.Context, fromStoreID, toStoreID int, copyMode
|
|||||||
// return 0, fmt.Errorf("源门店:%d与目标门店:%d相同", fromStoreID, toStoreID)
|
// return 0, fmt.Errorf("源门店:%d与目标门店:%d相同", fromStoreID, toStoreID)
|
||||||
sql := `
|
sql := `
|
||||||
UPDATE store_sku_bind t1
|
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 = ?,
|
SET t1.last_operator = ?,
|
||||||
t1.updated_at = ?,
|
t1.updated_at = ?,
|
||||||
t1.price = t1.price * ? / 100,
|
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 = ?
|
WHERE t1.store_id = ? AND t1.deleted_at = ?
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{
|
sqlParams := []interface{}{
|
||||||
|
utils.DefaultTimeValue,
|
||||||
|
utils.DefaultTimeValue,
|
||||||
|
utils.DefaultTimeValue,
|
||||||
userName,
|
userName,
|
||||||
now,
|
now,
|
||||||
pricePercentage,
|
pricePercentage,
|
||||||
|
|||||||
Reference in New Issue
Block a user