- update local status when cancel promotion successfully

This commit is contained in:
gazebo
2018-11-05 15:34:22 +08:00
parent 7c07d65c48
commit f24a9d6bb6

View File

@@ -339,8 +339,9 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params
promotion.Status = model.PromotionStatusRemoteFailed promotion.Status = model.PromotionStatusRemoteFailed
} }
db := dao.GetDB() db := dao.GetDB()
dao.WrapUpdateULEntity(promotion, userName) _, err = dao.UpdateEntityLogically(db, promotion, map[string]interface{}{
_, err = dao.UpdateEntity(db, promotion, "Status") "Status": promotion.Status,
}, ctx.GetUserName(), nil)
} }
return nil, err return nil, err
}, 4) }, 4)
@@ -542,7 +543,11 @@ func CancelJdPromotion(ctx *jxcontext.Context, promotionID int) (err error) {
if promotionHandler == nil { if promotionHandler == nil {
return errors.New("非法的促销类型") return errors.New("非法的促销类型")
} }
err = promotionHandler.CancelPromotion(utils.Str2Int64(promotion.VendorPromotionID), "") if err = promotionHandler.CancelPromotion(utils.Str2Int64(promotion.VendorPromotionID), ""); err == nil {
_, err = dao.UpdateEntityLogically(db, promotion, map[string]interface{}{
"Status": model.PromotionStatusCanceled,
}, ctx.GetUserName(), nil)
}
return err return err
} }