BuildingManagementController.class.php 2.0 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Home\Controller;
  3. use Think\Controller;
  4. include '../Common/function.php';
  5. class BuildingManagementController extends ComController {
  6. public function index(){
  7. $data =I();
  8. $company_code=$data['companyid'];
  9. $company_data=M()->query("select owner_name,owner_address,building_id,xmlx from sp_owner_company where owner_id='".$company_code."'");
  10. $res=M()->query("select build_name,address from sp_building where id='".$company_data[0]['building_id']."'");
  11. $hj_device_data=M()->query("select count(*) as sl from sp_owner where company='".$company_code."' and dwtype=1");
  12. $sj_device_data=M()->query("select count(*) as sl from sp_owner where company='".$company_code."' and dwtype=2");
  13. $yg_device_data=M()->query("select count(*) as sl from sp_owner where company='".$company_code."' and dwtype=3");
  14. $yw_device_data=M()->query("select count(*) as sl from sp_owner where company='".$company_code."' and dwtype=5");
  15. $rtu_device_data=M()->query("select count(*) as sl from sp_owner where company='".$company_code."' and dwtype=6");
  16. $dq_device_data=M()->query("select count(*) as sl from sp_owner where company='".$company_code."' and dwtype=7");
  17. $sp_device_data=M()->query("select count(*) as sl from sp_owner where company='".$company_code."' and dwtype=16");
  18. $this->assign('hj_device_data',$hj_device_data[0]['sl']);
  19. $this->assign('sj_device_data',$sj_device_data[0]['sl']);
  20. $this->assign('yg_device_data',$yg_device_data[0]['sl']);
  21. $this->assign('yw_device_data',$yw_device_data[0]['sl']);
  22. $this->assign('rtu_device_data',$rtu_device_data[0]['sl']);
  23. $this->assign('dq_device_data',$dq_device_data[0]['sl']);
  24. $this->assign('sp_device_data',$sp_device_data[0]['sl']);
  25. $this->assign('company_code',$company_code);
  26. $this->assign('res',$res[0]);
  27. $this->assign('company_data',$company_data[0]);
  28. $this->display('Index/building_management');
  29. }
  30. }