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

equipment

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