作者 董瑞恩
1 个管道 的构建 通过 耗费 1 秒

equipment

@@ -35,9 +35,24 @@ use think\Db; @@ -35,9 +35,24 @@ use think\Db;
35 class AdminEquipmentController extends AdminBaseController{ 35 class AdminEquipmentController extends AdminBaseController{
36 36
37 public function index(){ 37 public function index(){
38 -  
39 -  
40 - 38 + $param=$this->request->param();
  39 + dump($param);
  40 + $where=array();
  41 + if (!empty($param['name'])){
  42 + $where['name']=['like','%'.$param['name'].'%'];
  43 + }
  44 + if (!empty($param['hospital'])){
  45 + $where['hospital']=$param['hospital'];
  46 + }
  47 + if (!empty($param['note'])){
  48 + $where['note']=['like','%'.$param['note'].'%'];
  49 + }
  50 + if (!empty($param['start_number'])&&!empty($param['end_number'])){
  51 + $where['serial_number']=['between',[$param['start_number'],$param['end_number']]];
  52 + }
  53 + if (!empty($param['start_time'])&&!empty($param['end_time'])){
  54 + $where['create_time']=['between',[strtotime($param['start_time']),strtotime($param['end_time'])]];
  55 + }
41 $Equipment=new EquipmentModel(); 56 $Equipment=new EquipmentModel();
42 $data=$Equipment->paginate(10); 57 $data=$Equipment->paginate(10);
43 $this->assign('data',$data); 58 $this->assign('data',$data);
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 <li class="active"><a href="javascript:;">设备列表</a></li> 6 <li class="active"><a href="javascript:;">设备列表</a></li>
7 </ul> 7 </ul>
8 <form class="well form-inline margin-top-20" method="post" action="{:url('AdminEquipment/index')}"> 8 <form class="well form-inline margin-top-20" method="post" action="{:url('AdminEquipment/index')}">
9 -  
10 设备名称: 9 设备名称:
11 <input type="text" class="form-control" name="name" style="width: 200px;" 10 <input type="text" class="form-control" name="name" style="width: 200px;"
12 value="{$name|default=''}" placeholder="请输入关键字..."> 11 value="{$name|default=''}" placeholder="请输入关键字...">