巴林闲侠
1 year ago
7 changed files with 219 additions and 19 deletions
@ -0,0 +1,31 @@ |
|||
'use strict'; |
|||
const moment = require('moment') |
|||
|
|||
async function getAnspectionNotificationPhone (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
let findOption = { |
|||
where: { |
|||
|
|||
}, |
|||
order: [['id', 'DESC']] |
|||
} |
|||
const roadRes = await models.AnspectionNotificationPhone.findAll(findOption) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = roadRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
module.exports = { |
|||
getAnspectionNotificationPhone, |
|||
}; |
@ -0,0 +1,35 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const AnspectionNotificationPhone = sequelize.define("inspection_notification_phone", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "assess_id_uindex" |
|||
}, |
|||
phone: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "联系电话", |
|||
primaryKey: false, |
|||
field: "phone", |
|||
autoIncrement: false |
|||
}, |
|||
|
|||
}, { |
|||
tableName: "inspection_notification_phone", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.AnspectionNotificationPhone = AnspectionNotificationPhone; |
|||
return AnspectionNotificationPhone; |
|||
}; |
Loading…
Reference in new issue