Browse Source

projectGet 增加 doneState 筛选

dev
巴林闲侠 2 years ago
parent
commit
9fb7356f97
  1. 9
      api/app/lib/controllers/data/project.js

9
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)

Loading…
Cancel
Save