|
|
@ -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); |
|
|
|
} |
|
|
|