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

[fix]

parent e9b319c4
Pipeline #6688 passed with stage
in 17 seconds
...@@ -22,7 +22,7 @@ module.exports = app => { ...@@ -22,7 +22,7 @@ module.exports = app => {
}, },
taskId: { taskId: {
type: DataTypes.STRING(50), type: DataTypes.STRING(50),
allowNull: false, allowNull: true,
defaultValue: '', defaultValue: '',
field: 'taskId', field: 'taskId',
}, },
...@@ -38,7 +38,7 @@ module.exports = app => { ...@@ -38,7 +38,7 @@ module.exports = app => {
defaultValue: '', defaultValue: '',
field: 'cityId', field: 'cityId',
}, },
appkey: { appKey: {
type: DataTypes.STRING(100), type: DataTypes.STRING(100),
allowNull: false, allowNull: false,
field: 'appKey', field: 'appKey',
......
...@@ -30,10 +30,8 @@ class OrderService extends Service { ...@@ -30,10 +30,8 @@ class OrderService extends Service {
where: { orderId: params.orderId }, where: { orderId: params.orderId },
order: [['createDate', 'DESC']], order: [['createDate', 'DESC']],
}); });
// console.log(order); if (order.length === 0) {
if (order.length === 0) { // 创建订单号 ctx.throw(400, { message: 'no order' });
// await ctx.model.TaskStatus.create(params);
ctx.throw(400, { message: 'no orderId' });
return; return;
} }
for (const item of order) { for (const item of order) {
...@@ -46,8 +44,9 @@ class OrderService extends Service { ...@@ -46,8 +44,9 @@ class OrderService extends Service {
if (taskId) { if (taskId) {
await ctx.model.TaskStatus.create({ appKey, status: 'init', notifyUrl, backUrl, userId, ...params }); await ctx.model.TaskStatus.create({ appKey, status: 'init', notifyUrl, backUrl, userId, ...params });
} else { } 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