Commit 2bcab4ca authored by 高诸锋's avatar 高诸锋

[fix]

parent e9b319c4
Pipeline #6688 passed with stage
in 17 seconds
......@@ -22,7 +22,7 @@ module.exports = app => {
},
taskId: {
type: DataTypes.STRING(50),
allowNull: false,
allowNull: true,
defaultValue: '',
field: 'taskId',
},
......@@ -38,7 +38,7 @@ module.exports = app => {
defaultValue: '',
field: 'cityId',
},
appkey: {
appKey: {
type: DataTypes.STRING(100),
allowNull: false,
field: 'appKey',
......
......@@ -30,10 +30,8 @@ class OrderService extends Service {
where: { orderId: params.orderId },
order: [['createDate', 'DESC']],
});
// console.log(order);
if (order.length === 0) { // 创建订单号
// await ctx.model.TaskStatus.create(params);
ctx.throw(400, { message: 'no orderId' });
if (order.length === 0) {
ctx.throw(400, { message: 'no order' });
return;
}
for (const item of order) {
......@@ -46,8 +44,9 @@ class OrderService extends Service {
if (taskId) {
await ctx.model.TaskStatus.create({ appKey, status: 'init', notifyUrl, backUrl, userId, ...params });
} else {
order[0].update(params);
await order[0].update(params);
}
return order[0];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment