Authored by 陈峰

Merge branch 'hotfix/presale-cart-message' into 'release/6.8.6'

预售商品在购物车中结算时给予错误提示



See merge request !1686
... ... @@ -98,12 +98,23 @@ const select = (req, res, next) => {
// uid = 20422448;
return req.ctx(cartModel).selectGood(uid, skuList, shoppingKey, cartType).then(data => {
data ? res.json({
code: 200,
data
}) : res.status(400).json({
message: '操作失败'
});
if (data) {
if (data.code !== 500) {
res.json({
code: 200,
data
});
} else {
res.status(400).json({
code: 500,
message: data.message || '操作失败!'
});
}
} else {
res.status(400).json({
message: '操作失败'
});
}
}).catch(next);
};
... ...
... ... @@ -48,7 +48,13 @@ class cartModel extends global.yoho.BaseModel {
shopping_key: shoppingKey,
is_support_mlp: 'Y'
}}).then((data) => {
return data.code === 200 ? cartProcess.processData(data, cartType) : void 0;
if (data.code === 200) {
return cartProcess.processData(data, cartType);
} else if (data.code === 500) {
return data;
} else {
return void 0;
}
});
}
... ...