From 8334e2ab4990117c634158b1af3e54de2cadf27b Mon Sep 17 00:00:00 2001 From: zhaojintian <729234283@qq.com> Date: Wed, 23 Oct 2019 04:02:41 +0800 Subject: [PATCH] update --- src/extends/controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extends/controller.js b/src/extends/controller.js index 29e1b1d..cb67c5b 100644 --- a/src/extends/controller.js +++ b/src/extends/controller.js @@ -49,14 +49,14 @@ module.exports = app => { * @private */ async _get (ctx) { + const { attributes, offset, limit, where, order } = app.$helpers.formatQuery(ctx.request.query) + if (ctx.params.id) { ctx.send({ status: 200, - data: await this.service.find({ id: ctx.params.id }) + data: await this.service.find({ id: ctx.params.id, attributes }) }) } else { - const { attributes, offset, limit, where, order } = app.$helpers.formatQuery(ctx.request.query) - ctx.send({ status: 200, data: {