Commit dca4c80d authored by 姜登's avatar 姜登

增加attribute

parent a11644bf
Pipeline #17483 passed with stage
in 5 seconds
......@@ -4,7 +4,7 @@
* @Author: jd
* @Date: 2019-02-25 18:59:53
* @LastEditors: jd
* @LastEditTime: 2019-11-27 16:47:01
* @LastEditTime: 2019-11-27 17:07:39
*/
'use strict';
......@@ -34,6 +34,7 @@ class CacheService extends Service {
}
const order = await ctx.model.TaskStatus.findOne({
attributes: ['id', 'status'],
where: { taskId: key },
});
if (order && order.status !== 'success') {
......
......@@ -4,7 +4,7 @@
* @Author: jd
* @Date: 2019-02-25 18:59:53
* @LastEditors: jd
* @LastEditTime: 2019-11-27 16:40:19
* @LastEditTime: 2019-11-27 17:47:04
*/
'use strict';
......@@ -14,6 +14,7 @@ class OrderService extends Service {
async getOneByOrderId(params) {
const { ctx } = this;
const order = await ctx.model.TaskStatus.findOne({
attributes: ['id', 'order'],
where: params,
});
return order;
......@@ -35,6 +36,7 @@ class OrderService extends Service {
async update(params) {
const { ctx } = this;
const order = await ctx.model.TaskStatus.findAll({
attributes: ['id', 'status'],
where: { orderId: params.orderId },
order: [['createDate', 'DESC']],
});
......@@ -55,6 +57,7 @@ class OrderService extends Service {
await order[0].update(params);
}
await ctx.nodemodel.GjjStatus.findOrCreate({
attributes: ['id'],
where: {
orderId: params.orderId,
},
......
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