This commit is contained in:
gazebo
2019-06-21 11:02:16 +08:00
parent 9d01bddc65
commit 7f44446390
3 changed files with 151 additions and 43 deletions

View File

@@ -257,9 +257,7 @@ func deleteActStoreBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, actSto
isStoreSkuAllDeleted := true
for _, actStoreSku := range actStoreSkuMap[actStore.StoreID] {
if actStoreSku == nil || actStoreSkuParamMap[jxutils.Combine2Int(actStoreSku.StoreID, actStoreSku.SkuID)] != nil {
objActStoreSkuMap := &model.ActStoreSkuMap{}
objActStoreSkuMap.ID = actStoreSku.MapID
if _, err = dao.UpdateEntityLogically(db, objActStoreSkuMap, map[string]interface{}{
if _, err = dao.UpdateEntityLogically(db, partner.ActStoreSku2ActStoreSkuMap(actStoreSku), map[string]interface{}{
model.FieldSyncStatus: actStoreSku.SyncStatus | model.SyncFlagDeletedMask,
}, ctx.GetUserName(), nil); err != nil {
return err
@@ -269,7 +267,7 @@ func deleteActStoreBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, actSto
}
}
if isStoreSkuAllDeleted {
if _, err = dao.UpdateEntityLogically(db, &actStore.ActStoreMap, map[string]interface{}{
if _, err = dao.UpdateEntityLogically(db, partner.ActStore2ActStoreMap(actStore), map[string]interface{}{
model.FieldSyncStatus: actStore.SyncStatus | model.SyncFlagDeletedMask,
}, ctx.GetUserName(), nil); err != nil {
return err
@@ -281,9 +279,7 @@ func deleteActStoreBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, actSto
}
if isStoreAllDeleted {
objActMap := &model.ActMap{}
objActMap.ID = act.MapID
if _, err = dao.UpdateEntityLogically(db, objActMap, map[string]interface{}{
if _, err = dao.UpdateEntityLogically(db, partner.Act2ActMap(act), map[string]interface{}{
model.FieldSyncStatus: act.SyncStatus | model.SyncFlagDeletedMask,
}, ctx.GetUserName(), nil); err != nil {
return err