1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace Home\Controller;
- use Think\Controller;
- class WateroneController extends ComController{
- public function index()
- {
- // echo $_SESSION['phone'];
- // echo "<br/>....";
- // echo $_SESSION['idphone'];
- $Data=I('');
- $Map['company']=$Data['companyid'];
- $Map['company']=10063;
- $Map['clzt']=0;
- $ResData=M('v_sj2017')->where($Map)->count('id');
- $this->assign('wjcn',$ResData);
- $this->assign('companyid',$Data['companyid']);
- $this->display('Index/water_systemone');
- }
- public function chang(){
- $Data=I('');
- $a['company'] = $Data['companyid'];
- $Map['company']=$Data['companyid'];
- switch ($Data['type'])
- {
- case 'untreated':
- $Map['clzt']=0;
- break;
- case 'treated':
- $Map['clzt']=1;
- break;
- default:
- break;
- }
- $p1=I('get.p1');
- if(empty($p1)){//判断$aoData是否为空如果为空则$p1=1
- $p1=1;
- //echo $p1;
- }
- $cont=M('v_sj2017')->where($a)->cont();//总共的条数
- $p=ceil($cont/10);//总页数
- $ResData=M('v_sj2017')->where($Map)->order("time desc")->page($p1,10)->select();
- $this->assign('p',$p);//传出的总页数
- //return $ResData;
- //$this->display('Index/water_system');
- if($p1 == 1){//
- $this->assign('ResData',$ResData);
- $this->display('Index/water-list');
- }else{
- return $ResData;
- }
- }
- }
- ?>
|