LifterController.class.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace Home\Controller;
  3. use Think\Controller;
  4. include '../Common/function.php';
  5. class LifterController extends ComController{
  6. public function index()
  7. {
  8. // echo $_SESSION['phone'];
  9. // echo "<br/>....";
  10. // echo $_SESSION['idphone'];
  11. $Data = I('');
  12. $Map['company']=$Data['companyid'];
  13. $Map['clzt']=0;
  14. $ResData=M()->query("select count(a.id) as wcls from sp_lifter2017 as a join sp_owner as b on a.device_code=b.owner_code where b.company=".$Map['company']." and a.clzt=0");
  15. // $ResData=M('lifter2017')->where($Map)->count('id');
  16. // $ResData = indexOne($company);
  17. // print_r($Map);
  18. // print_r($ResData);
  19. $this->assign('wjcn',$ResData[0]['wcls']);
  20. $this->assign('companyid',$Data['companyid']);
  21. $this->display('Index/lifter_system');
  22. }
  23. public function change()
  24. {
  25. $Data=I('');
  26. $Map['company']=$Data['companyid'];
  27. switch ($Data['type'])
  28. {
  29. case 'untreated':
  30. $Map['clzt']=0;
  31. break;
  32. case 'treated':
  33. $Map['clzt']=1;
  34. break;
  35. default:
  36. break;
  37. }
  38. $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']);
  39. // $ResData=M('v_ef2017')->where($Map)->order('time desc')->select();
  40. foreach ($ResData as $key=>$value){
  41. if ($ResData[$key]['data1']!='EF9'){
  42. $ResData[$key]['wtype']='在线';
  43. }
  44. }
  45. $this->assign('ResData',$ResData);
  46. // s_print($ResData);
  47. $this->display('Index/efire-list');
  48. }
  49. //public function change()
  50. // {
  51. // $Data = I('');
  52. // $company = $Data['companyid'];
  53. // $type = $Data['type'];
  54. //
  55. // $ResData = indexTwo($company,$type);
  56. //// print_r($ResData);exit();
  57. // $this->assign('ResData',$ResData);
  58. // $this->display('Index/water-list');
  59. // }
  60. }
  61. ?>