完善保险端前后端和养殖端小程序

This commit is contained in:
xuqiuyun
2025-09-22 19:09:45 +08:00
parent 02a25515a9
commit 325c114c38
256 changed files with 48348 additions and 4444 deletions

View File

@@ -303,31 +303,31 @@ const IotCattle = sequelize.define('IotCattle', {
comment: '物联网牛只表'
});
// 定义关联关系
IotCattle.associate = (models) => {
// 关联到农场
IotCattle.belongsTo(models.Farm, {
foreignKey: 'orgId',
as: 'farm'
});
// 关联关系已在 models/index.js 中定义
// IotCattle.associate = (models) => {
// // 关联到农场
// IotCattle.belongsTo(models.Farm, {
// foreignKey: 'orgId',
// as: 'farm'
// });
// 关联到批次
IotCattle.belongsTo(models.CattleBatch, {
foreignKey: 'batchId',
as: 'batch'
});
// // 关联到批次
// IotCattle.belongsTo(models.CattleBatch, {
// foreignKey: 'batchId',
// as: 'batch'
// });
// 关联到栏舍
IotCattle.belongsTo(models.CattlePen, {
foreignKey: 'penId',
as: 'pen'
});
// // 关联到栏舍
// IotCattle.belongsTo(models.CattlePen, {
// foreignKey: 'penId',
// as: 'pen'
// });
// 关联到围栏
IotCattle.belongsTo(models.ElectronicFence, {
foreignKey: 'fenceId',
as: 'fence'
});
};
// // 关联到围栏
// IotCattle.belongsTo(models.ElectronicFence, {
// foreignKey: 'fenceId',
// as: 'fence'
// });
// };
module.exports = IotCattle;