- update local status when cancel promotion successfully
This commit is contained in:
@@ -339,8 +339,9 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params
|
||||
promotion.Status = model.PromotionStatusRemoteFailed
|
||||
}
|
||||
db := dao.GetDB()
|
||||
dao.WrapUpdateULEntity(promotion, userName)
|
||||
_, err = dao.UpdateEntity(db, promotion, "Status")
|
||||
_, err = dao.UpdateEntityLogically(db, promotion, map[string]interface{}{
|
||||
"Status": promotion.Status,
|
||||
}, ctx.GetUserName(), nil)
|
||||
}
|
||||
return nil, err
|
||||
}, 4)
|
||||
@@ -542,7 +543,11 @@ func CancelJdPromotion(ctx *jxcontext.Context, promotionID int) (err error) {
|
||||
if promotionHandler == nil {
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user