From 304f3fe86ed40ebb8dde2f736a6585c3f481b7e9 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 9 Aug 2019 10:00:53 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=90=AF=E7=94=A8DeleteSkusFromAct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 15 ++++++++++----- business/model/dao/act.go | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 424a06e5d..4f547caa3 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -842,10 +842,12 @@ func DeleteSkusFromAct(ctx *jxcontext.Context, vendorID int, skuIDs []int, isAsy } } if len(deleteList) > 0 { - globals.SugarLogger.Debug(utils.Format4Output(deleteList, false)) - // if err = DeleteActStoreSkuBind(ctx, db, actID, deleteList); err == nil { - // _, err = SyncAct(ctx, task, actID, nil, nil, skuIDs, false) - // } + // globals.SugarLogger.Debug(utils.Format4Output(deleteList, false)) + if err = DeleteActStoreSkuBind(ctx, db, actID, deleteList); err == nil { + if _, err = SyncAct(ctx, task, actID, nil, nil, skuIDs, false); err == nil { + retVal = deleteList + } + } } } return retVal, err @@ -854,7 +856,10 @@ func DeleteSkusFromAct(ctx *jxcontext.Context, vendorID int, skuIDs []int, isAsy if isAsync { hint = task.GetID() } else { - _, err = task.GetResult(0) + resultList, err2 := task.GetResult(0) + if err = err2; err == nil { + hint = utils.Int2Str(len(resultList)) + } } return hint, err } diff --git a/business/model/dao/act.go b/business/model/dao/act.go index d2e90f6c6..2fd6d9418 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -373,8 +373,8 @@ func GetEffectiveActStoreSkuInfo(db *DaoDB, actID int, vendorIDs []int, storeIDs sql += " AND t2.sku_id IN (" + GenQuestionMarks(len(skuIDs)) + ")" sqlParams = append(sqlParams, skuIDs) } - // globals.SugarLogger.Debug(sql) - // globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false)) + globals.SugarLogger.Debug(sql) + globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false)) err = GetRows(db, &actStoreSkuList, sql, sqlParams...) return actStoreSkuList, err }