明树Git Lab

Commit 32d33e3a authored by zfp1's avatar zfp1

update

parent c4679568
...@@ -131,7 +131,7 @@ ProjectBjtj.belongsTo(Project, { foreignKey: 'projectId' }); ...@@ -131,7 +131,7 @@ ProjectBjtj.belongsTo(Project, { foreignKey: 'projectId' });
Project.hasMany(ProjectCwpjzb, { foreignKey: 'projectId', as: 'projectCwpjzbs' }); Project.hasMany(ProjectCwpjzb, { foreignKey: 'projectId', as: 'projectCwpjzbs' });
ProjectCwpjzb.belongsTo(Project, { foreignKey: 'projectId' }); ProjectCwpjzb.belongsTo(Project, { foreignKey: 'projectId' });
/**项目-项目附件 1:n */ /**项目-项目附件 1:n */
Project.hasMany(File, { through: 'jt_project_file', foreignKey: 'projectId', as: 'files', otherKey: 'fileId' }); Project.belongsToMany(File, { through: 'jt_project_file', foreignKey: 'projectId', as: 'files', otherKey: 'fileId' });
File.belongsTo(Project, { through: 'jt_project_file', foreignKey: 'fileId', otherKey: 'projectId' }); File.belongsTo(Project, { through: 'jt_project_file', foreignKey: 'fileId', otherKey: 'projectId' });
/**项目-股东信息 1:n */ /**项目-股东信息 1:n */
Project.hasMany(ProjectGdxx, { foreignKey: 'projectId', as: 'projectGdxxs' }); Project.hasMany(ProjectGdxx, { foreignKey: 'projectId', as: 'projectGdxxs' });
......
// models/User.js // models/User.js
const { DataTypes } = require('sequelize'); const { DataTypes } = require('sequelize');
const sequelize = require('../index'); const sequelize = require('../index');
const File = require('./file'); const File = require('../system/file');
const Project = require('./project'); const Project = require('./project');
const projectFile = sequelize.define('projectFile', { const projectFile = sequelize.define('projectFile', {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment