From 5fe56db39fd0ea0085c4049bf3120fb97ef33af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Sun, 26 Apr 2020 14:03:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=8F=9C=E5=B8=82=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=88=B0=E6=9E=9C=E5=9B=AD=E6=9B=B4=E6=96=B0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 7a943c357..ab5c60c92 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -4456,8 +4456,13 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool) } }() if v != nil { - dao.WrapAddIDCULEntity(v, ctx.GetUserName()) - if num1, err := dao.UpdateEntity(db, v, "SpecQuality", "SpecUnit", "EclpID"); err != nil { + sql := ` + UPDATE sku SET spec_quality = ?, sepc_unit = ?, eclp_id = ?, updated_at = ?, last_operator = ? + WHERE eclp_id = ? + AND deleted_at = ? + ` + sqlParams := []interface{}{v.SpecQuality, v.SpecUnit, v.EclpID, time.Now(), ctx.GetUserName(), v.EclpID, utils.DefaultTimeValue} + if num1, err := dao.ExecuteSQL(db, sql, sqlParams); err != nil { dao.Rollback(db) return retVal, err } else { @@ -4465,8 +4470,16 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool) } } if skuName != nil { - dao.WrapAddIDCULEntity(skuName, ctx.GetUserName()) - if num2, err := dao.UpdateEntity(db, skuName, "Name", "Img", "Img2", "DescImg", "Unit", "CategoryID", "Price"); err != nil { + sql := ` + UPDATE sku_name a + JOIN sku b ON a.id = b.name_id + SET a.name = ?, a.img = ?, a.img2 = ?, a.desc_img = ?, a.unit = ?, a.price = ?, updated_at = ?, lase_operator = ? + WHERE b.eclp_id = ? + AND a.deleted_at = ? + ` + sqlParams := []interface{}{skuName.Name, skuName.Img, skuName.Img2, skuName.DescImg, skuName.Unit, skuName.Price, + time.Now(), ctx.GetUserName(), v.EclpID, utils.DefaultTimeValue} + if num2, err := dao.ExecuteSQL(db, sql, sqlParams); err != nil { dao.Rollback(db) return retVal, err } else {