You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
607 B
25 lines
607 B
3 years ago
|
'use strict';
|
||
|
|
||
|
//获取南昌市下所有区县
|
||
|
async function getCountiesList(ctx) {
|
||
|
try {
|
||
|
const models = ctx.fs.dc.models;
|
||
|
let rslt = await models.Department.findAll({
|
||
|
where: { type: 2 },
|
||
|
order: [['id', 'asc']],
|
||
|
});
|
||
|
ctx.status = 200;
|
||
|
ctx.body = rslt;
|
||
|
} catch (error) {
|
||
|
console.log(error)
|
||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
|
||
|
ctx.status = 400;
|
||
|
ctx.body = {
|
||
|
"message": "获取南昌市下所有区县失败"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
getCountiesList,
|
||
|
};
|