Browse Source

(*)首页获取巡检数据接口修改

master
wuqun 2 years ago
parent
commit
c1f48b1572
  1. 5
      api/app/lib/controllers/patrolManage/patrolRecord.js
  2. 3
      api/app/lib/index.js
  3. BIN
      web/client/assets/images/homePage/rank1.png
  4. BIN
      web/client/assets/images/homePage/rank2.png

5
api/app/lib/controllers/patrolManage/patrolRecord.js

@ -45,7 +45,10 @@ async function findPatrolRecord (ctx, next) {
where: {
inspectionTime: { $between: [startTime, endTime] }
},
include: generalInclude
include: generalInclude.concat([{
model: models.Point,
attributes: ['id', 'name']
}])
});
} else {
rslt = await models.PatrolRecord.findAll({

3
api/app/lib/index.js

@ -65,6 +65,9 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
PatrolRecordIssueHandle.belongsTo(PatrolRecord, { foreignKey: 'patrolRecordId', targetKey: 'id' });
PatrolRecord.hasMany(PatrolRecordIssueHandle, { foreignKey: 'patrolRecordId', sourceKey: 'id' });
PatrolRecord.belongsTo(Point, { foreignKey: 'pointId', targetKey: 'id' });
Point.hasMany(PatrolRecord, { foreignKey: 'pointId', sourceKey: 'id' });
UserResource.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' });
User.hasMany(UserResource, { foreignKey: 'userId', sourceKey: 'id' });

BIN
web/client/assets/images/homePage/rank1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
web/client/assets/images/homePage/rank2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Loading…
Cancel
Save