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

interface

... ... @@ -29,13 +29,21 @@ use think\Db;
class AdminFaultController extends AdminBaseController{
public function index(){
$param=$this->request->param();
$where=array();
if (!empty($param['fault_type'])){
$where['fault_type']=$param['fault_type'];
}
$data=Db::name('fault')
->alias('a')
->field('a.*,b.serial_number,b.hospital')
->join('equipment b','a.eq_name=b.name')
->where($where)
->order('a.create_time','desc')
->paginate(10);
$this->assign('data',$data);
$this->assign('fault_type', isset($param['fault_type']) ? $param['fault_type'] : '');
return $this->fetch();
}
... ...
... ... @@ -7,11 +7,11 @@
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('AdminFault/index')}">
分类:
<select class="form-control" name="category" style="width: 140px;">
<select class="form-control" name="fault_type" style="width: 140px;">
<option value='0'>全部</option>
<option value='1'>计费</option>
<option value='2'>床体</option>
<option value='3'>床锁</option>
<option value='3' readonly>床锁</option>
<option value='4'>其他</option>
</select> &nbsp;&nbsp;
<input type="submit" class="btn btn-primary" value="搜索"/>
... ...