'use strict'; // 查询业绩汇总表-->关联sale表 async function getSalePerformance(ctx, next) { const { type } = ctx.params; const models = ctx.fs.dc.models; let rslt = null; try { rslt = await models.sale.findAll({ order: [['id', 'DESC']], include:[{ model:models.salePerformance }] // where: { type: type } }) ctx.status = 200 ctx.body = rslt } catch (error) { ctx.fs.logger.error(`path:${ctx.path},error:${error}`) ctx.status = 400; ctx.body = { name: 'FindAllError', message: '获取失败' } } } module.exports = { getSalePerformance, }