dever 6 years ago
parent
commit
5a0f10f826
1 changed files with 7 additions and 2 deletions
  1. 7 2
      admin/page/device.py

+ 7 - 2
admin/page/device.py

@@ -24,12 +24,17 @@ class gateway_path(Load):
 			,state = False
 		)
 		self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
+
+		farm_list = {}
+		for value in self.data['common']['search_farm_id-select-']:
+			farm_list[value['id']] = value
+
 		self.commonList('device_gateway')
 		if self.data['list']:
 			for key, value in enumerate(self.data['list']):
-				farm = self.service('common').one('farm', id=value['farm_id'])
+				farm = farm_list[value['farm_id']]
 				self.data['list'][key]['farm'] = farm['name']
-				device = self.service('common').list('device_info', search={'hardware_id':value['hardware_id']})
+				device = self.service('common').list('device_info', search={'hardware_id':value['hardware_id'],'hardware_type--ins':(4,5)})
 				self.data['list'][key]['status'] = '断开'
 				self.data['list'][key]['power_status'] = '断开'
 				self.data['list'][key]['power_num'] = 0