Authored by yyq

fix ctx

@@ -61,7 +61,7 @@ const convertCoupons = (req, res, next) => { @@ -61,7 +61,7 @@ const convertCoupons = (req, res, next) => {
61 61
62 // 获取礼品卡列表 62 // 获取礼品卡列表
63 const getGiftCards = (req, res, next) => { 63 const getGiftCards = (req, res, next) => {
64 - oeModel.getGiftCards(req.user.uid).then(data => { 64 + req.ctx(oeModel)..getGiftCards(req.user.uid).then(data => {
65 if (data.data) { 65 if (data.data) {
66 data.data.userMobile = req.user.mobile; 66 data.data.userMobile = req.user.mobile;
67 } 67 }
@@ -91,7 +91,7 @@ const sendCheckSms = (req, res, next) => { @@ -91,7 +91,7 @@ const sendCheckSms = (req, res, next) => {
91 let params = req.body; 91 let params = req.body;
92 92
93 if (params.giftCard) { 93 if (params.giftCard) {
94 - return oeModel.sendGiftCardCkeckSms(req.user.uid, req.yoho.udid).then(result => { 94 + return req.ctx(oeModel).sendGiftCardCkeckSms(req.user.uid, req.yoho.udid).then(result => {
95 res.json(result); 95 res.json(result);
96 }).catch(next); 96 }).catch(next);
97 } 97 }
@@ -105,7 +105,7 @@ const submitCheck = (req, res, next) => { @@ -105,7 +105,7 @@ const submitCheck = (req, res, next) => {
105 105
106 // 带礼品卡号和短信验证码,则校验短信验证码,否则删除使用礼品卡 106 // 带礼品卡号和短信验证码,则校验短信验证码,否则删除使用礼品卡
107 if (req.body.giftCard && checkCode) { 107 if (req.body.giftCard && checkCode) {
108 - return oeModel.checkGiftCardSmsCode(req.user.uid, checkCode, req.yoho.udid).then(result => { 108 + return req.ctx(oeModel).checkGiftCardSmsCode(req.user.uid, checkCode, req.yoho.udid).then(result => {
109 if (result.code === 200) { 109 if (result.code === 200) {
110 return next(); 110 return next();
111 } 111 }