Authored by 郝肖肖

'门票ctx'

... ... @@ -2,7 +2,7 @@
* Created by TaoHuang on 2017/6/22.
*/
const api = require('./ticket-api');
const TicketApi = require('./ticket-api');
const _ = require('lodash');
const helpers = global.yoho.helpers;
const OrderEnsureHandle = require('./order-ensure-handle');
... ... @@ -25,7 +25,7 @@ module.exports = class extends global.yoho.BaseModel {
}
addTicket(uid, sku, count, yohoCoin) {
return api.add(uid, sku, count, yohoCoin).then(ticketInfo => {
return new TicketApi(this.ctx).add(uid, sku, count, yohoCoin).then(ticketInfo => {
let result = {};
if (_.isEmpty(ticketInfo)) {
... ... @@ -55,7 +55,7 @@ module.exports = class extends global.yoho.BaseModel {
}
submitTicket(uid, sku, count, mobile, yohoCoin) {
return api.submit(uid, sku, count, mobile, yohoCoin).then(result => {
return new TicketApi(this.ctx).submit(uid, sku, count, mobile, yohoCoin).then(result => {
if (_.isEmpty(result)) {
return {
code: 500,
... ...