Commit 9be6d4ad authored by 何娜's avatar 何娜

fix通知

parent 04d6d96b
Pipeline #6179 passed with stage
in 2 seconds
......@@ -80,6 +80,7 @@ class OrderController extends Controller {
const result = await service.signature.partnerOrderId(ctx.request.body);
await service.order.create({
orderId: result.data.orderSn,
notifyUrl: ctx.app.notifyMap.get(appKey) && ctx.app.notifyMap.get(appKey).notifyUrl || '',
taskId: '',
userId: '',
cityId: '',
......
......@@ -87,7 +87,6 @@ class TaskController extends Controller {
async handleCallback() {
const {ctx, service} = this;
ctx.logger.info('【handleCallback】', ctx.request.body);
const {taskId} = ctx.request.body;
const result = await service.task.fetchTask({taskId});
ctx.success();
......@@ -133,15 +132,9 @@ class TaskController extends Controller {
if (!order) {
throw new Error('任务已经结束了');
}
const {orderId, appkey} = order;
const script = await service.scripts.fetchOneScripts(result.data.cityId);
result.cityId = Number(result.data.cityId);
result.cityName = script.hub_name || 'unknown';
result.taskId = taskId;
const {orderId} = order;
result.data = JSON.parse(result.data.data);
result.orderSn = orderId;
result.orderId = orderId;
result.appKey = appkey;
delete result.code;
delete result.msg;
await service.storage.write(result);
......
......@@ -103,6 +103,12 @@ module.exports = app => {
defaultValue: '',
field: 'text3',
},
notice: {
type: DataTypes.STRING(2),
allowNull: true,
defaultValue: '',
field: 'notice',
},
}, {
tableName: 'xuexin_status',
// timestamps: false,
......
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