|
@ -71,7 +71,7 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq |
|
|
PatrolTemplate.belongsTo(User, { foreignKey: 'createUserId', targetKey: 'id' }); |
|
|
PatrolTemplate.belongsTo(User, { foreignKey: 'createUserId', targetKey: 'id' }); |
|
|
User.hasMany(PatrolTemplate, { foreignKey: 'createUserId', sourceKey: 'id' }); |
|
|
User.hasMany(PatrolTemplate, { foreignKey: 'createUserId', sourceKey: 'id' }); |
|
|
|
|
|
|
|
|
CheckItems.belongsToMany(PatrolTemplate, { through: PatrolTemplateCheckItems, foreignKey: 'templateId', otherKey: 'checkItemsId' }); |
|
|
CheckItems.belongsToMany(PatrolTemplate, { through: PatrolTemplateCheckItems, foreignKey: 'checkItemsId', otherKey: 'templateId' }); |
|
|
PatrolTemplate.belongsToMany(CheckItems, { through: PatrolTemplateCheckItems, foreignKey: 'templateId', otherKey: 'checkItemsId' }); |
|
|
PatrolTemplate.belongsToMany(CheckItems, { through: PatrolTemplateCheckItems, foreignKey: 'templateId', otherKey: 'checkItemsId' }); |
|
|
|
|
|
|
|
|
UserResource.belongsTo(Resource, { foreignKey: 'resourceId', targetKey: 'code' }); |
|
|
UserResource.belongsTo(Resource, { foreignKey: 'resourceId', targetKey: 'code' }); |
|
|