From 9fb7356f970bb842a6d90a106298fce0d7510512 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 13 Jul 2023 09:37:10 +0800 Subject: [PATCH] =?UTF-8?q?projectGet=20=E5=A2=9E=E5=8A=A0=20doneState=20?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/data/project.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/app/lib/controllers/data/project.js b/api/app/lib/controllers/data/project.js index b1dec293..534ce7dc 100644 --- a/api/app/lib/controllers/data/project.js +++ b/api/app/lib/controllers/data/project.js @@ -3,7 +3,7 @@ async function projectGet (ctx) { try { const models = ctx.fs.dc.models; - const { type, entryName } = ctx.query; + const { type, entryName, doneState } = ctx.query; let findOption = { where: { @@ -19,6 +19,13 @@ async function projectGet (ctx) { $like: `%${entryName}%` } } + if (doneState) { + if (doneState == 'true') { + findOption.where.done = true + } else if (doneState == 'false') { + findOption.where.done = false + } + } const projectRes = await models.Project.findAll(findOption)