From 2937fdea8f81357ad8640f9b8a699446e5be3d55 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 24 Jul 2019 17:05:48 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=88=A0=E9=99=A4=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E8=A1=A5=E8=B4=B4=E5=95=86=E5=93=81=E6=97=B6=EF=BC=8CDeleteAct?= =?UTF-8?q?StoreSkuBind=E4=B8=AD=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 44c15ea5c..f42483e62 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -610,10 +610,20 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act for storeID := range actStoreSkuMap { for _, actStoreSku := range actStoreSkuMap[storeID] { if actStoreSkuParam == nil || actStoreSkuParamMap[jxutils.Combine2Int(actStoreSku.StoreID, actStoreSku.SkuID)] != nil { - if _, err = dao.UpdateEntityLogically(db, partner.ActStoreSku2ActStoreSkuMap(actStoreSku), - map[string]interface{}{ - model.FieldSyncStatus: actStoreSku.SyncStatus | model.SyncFlagDeletedMask, - }, ctx.GetUserName(), nil); err != nil { + if act.Type == model.ActSkuFake { + _, err = dao.DeleteEntityLogically(db, &model.ActStoreSkuMap{}, nil, ctx.GetUserName(), + map[string]interface{}{ + model.FieldActID: actID, + model.FieldStoreID: actStoreSku.StoreID, + model.FieldSkuID: actStoreSku.SkuID, + }) + } else { + _, err = dao.UpdateEntityLogically(db, partner.ActStoreSku2ActStoreSkuMap(actStoreSku), + map[string]interface{}{ + model.FieldSyncStatus: actStoreSku.SyncStatus | model.SyncFlagDeletedMask, + }, ctx.GetUserName(), nil) + } + if err != nil { return err } isDeleteAtLeastOne = true