Browse Source

注释

release_0.0.1
巴林闲侠 3 years ago
parent
commit
c64a6bff75
  1. 2
      api/app/lib/index.js

2
api/app/lib/index.js

@ -27,7 +27,7 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
});
const { User, Department } = dc.models;
// 定义外键
User.belongsTo(Department, { foreignKey: 'departmentId', targetKey: 'id' });
Department.hasMany(User, { foreignKey: 'departmentId', sourceKey: 'id' });
};

Loading…
Cancel
Save