Authored by 郭成尧

seckill-ctx

... ... @@ -82,7 +82,8 @@ exports.ensure = (req, res, next) => {
}
// 获取结算 数据
let paymentInfo = yield req.ctx(seckillModel).payment(paymentOption, orderInfo, orderComputerData.data);
let paymentInfo =
yield req.ctx(seckillModel).payment(paymentOption, orderInfo, _.get(orderComputerData, 'data'));
if (paymentInfo.code !== 200) {
view = {
... ... @@ -156,7 +157,6 @@ exports.compute = (req, res, next) => {
.catch(next);
};
exports.submit = (req, res, next) => {
const uid = req.user.uid,
sku = req.body.sku,
... ... @@ -238,13 +238,13 @@ exports.submit = (req, res, next) => {
// 使用礼品卡,发送验证码
if (options.gift_card_code) {
if (!verifyCode) {
yield orderModel.giftCardSendSms(uid);
yield req.ctx(orderModel).giftCardSendSms(uid);
return res.json({
code: 411
});
} else {
let verifyResult = yield orderModel.validRegCode({
let verifyResult = yield req.ctx(orderModel).validRegCode({
uid, verifyCode, udid
});
... ...