Browse Source

根据id查询巡检模板

master
liujiangyong 2 years ago
parent
commit
0893266ac5
  1. 5
      api/app/lib/controllers/patrolManage/patrolTemplate.js

5
api/app/lib/controllers/patrolManage/patrolTemplate.js

@ -4,7 +4,7 @@ async function getPatrolTemplate (ctx, next) {
try {
const models = ctx.fs.dc.models;
const { userId } = ctx.fs.api
const { limit, page } = ctx.query;
const { limit, page, id } = ctx.query;
let options = {
order: [['id', 'desc']],
include: [{
@ -18,6 +18,9 @@ async function getPatrolTemplate (ctx, next) {
attributes: ['name'],
}]
};
if (id) {
options.where.id = id;
}
if (limit) {
options.limit = Number(limit);
}

Loading…
Cancel
Save