123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace Home\Controller;
- use Think\Controller;
- include '../Common/function.php';
- class WaterController extends ComController{
- public function index()
- {
- // echo $_SESSION['phone'];
- // echo "<br/>....";
- // echo $_SESSION['idphone'];
- $Data = I('');
- $Map['company']=$Data['companyid'];
- $Map['clzt']=0;
- // $Map['dwtype']=2;
- $ResData=M('v_sj2017_2')->where($Map)->count('id');
- // $ResData = indexOne($company);
- // print_r($ResData);
- $this->assign('wjcn',$ResData);
- $this->assign('companyid',$Data['companyid']);
- $this->display('Index/water_system');
- }
- public function change()
- {
- $Data=I('');
- $Map['company']=$Data['companyid'];
- switch ($Data['type'])
- {
- case 'untreated':
- $Map['clzt']=0;
- break;
- case 'treated':
- $Map['clzt']=1;
- break;
- default:
- break;
- }
- $ResData=M()->query("select a.id,a.device_code,a.data1,a.clzt,a.time,d.owner_name from sp_ef2017 a join sp_owner d ON a.device_code=d.owner_code where company=".$Map['company']." AND clzt=".$Map['clzt']." and d.dwtype=2");
- // $ResData=M('v_ef2017')->where($Map)->order('time desc')->select();
- foreach ($ResData as $key=>$value){
- if ($ResData[$key]['data1']!='EF9'){
- $ResData[$key]['wtype']='在线';
- }
- }
- $this->assign('ResData',$ResData);
- // s_print($ResData);
- $this->display('Index/efire-list');
- }
- //public function change()
- // {
- // $Data = I('');
- // $company = $Data['companyid'];
- // $type = $Data['type'];
- //
- // $ResData = indexTwo($company,$type);
- //// print_r($ResData);exit();
- // $this->assign('ResData',$ResData);
- // $this->display('Index/water-list');
- // }
-
- }
- ?>
|