作者 潘浩文
1 个管道 的构建 通过 耗费 1 秒

XIAOPAN

... ... @@ -32,8 +32,9 @@ class AdminOrderController extends AdminBaseController{
public function index(){
$param=$this->request->param();
$where=array();
$where['a.state']=['in',[2,3]];
if (!empty($param['order_no'])){
$where['order_no']=['like','%'.$param['order_no'].'%'];
$where['a.order_no']=['like','%'.$param['order_no'].'%'];
}
if (!empty($param['mobile'])){
$where['u.mobile']=['like','%'.$param['mobile'].'%'];
... ... @@ -41,20 +42,23 @@ class AdminOrderController extends AdminBaseController{
if (!empty($param['users_id'])){
$where['u.id']=$param['users_id'];
}
$where['state']=['in',[2,3]];
if (!empty($param['state'])){
$where['a.state']=$param['state'];
}
$Order=new OrderModel();
$data=$Order->alias('a')
->join('users u','a.users_id=u.id')
// ->field('a.*,b.serial_number,b.hospital')
// ->join('equipment b','a.eq_name=b.name')
->where($where)
->order('end_time','desc')
->order('a.end_time','desc')
->paginate(10);
$this->assign('data',$data);
$this->assign('hospital', isset($param['hospital']) ? $param['hospital'] : '');
$this->assign('order_no', isset($param['order_no']) ? $param['order_no'] : '');
$this->assign('mobile', isset($param['mobile']) ? $param['mobile'] : '');
$this->assign('users_id', isset($param['users_id']) ? $param['users_id'] : '');
$this->assign('state', isset($param['state']) ? $param['state'] : '');
$this->assign('start_number', isset($param['start_number']) ? $param['start_number'] : '');
$this->assign('end_number', isset($param['end_number']) ? $param['end_number'] : '');
return $this->fetch();
... ...
... ... @@ -15,6 +15,12 @@
用户ID:
<input type="text" class="form-control" name="users_id" style="width: 200px;"
value="{$users_id|default=''}" placeholder="请输入用户id...">
支付状态:
<select type="text" class="form-control" name="state" style="width: 200px;">
<option value="">全部</option>
<option value="2" <eq name="state" value="2">selected</eq>>待支付</option>
<option value="3" <eq name="state" value="3">selected</eq>>已支付</option>
</select>
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('AdminOrder/index')}">清空</a>
</form>
... ...