作者 王晓刚
1 个管道 的构建 通过 耗费 1 秒

代理人注册

... ... @@ -17,6 +17,7 @@ class OrderController extends AdminBaseController
{
public function index(){
$where=[];
$whereor = '';
$param = $this->request->param();
$startTime = empty($param['start_time']) ? 0 : strtotime($param['start_time']);
$endTime = empty($param['end_time']) ? 0 : strtotime($param['end_time']);
... ... @@ -34,9 +35,24 @@ class OrderController extends AdminBaseController
if (!empty($keyword)) {
$where['u.nickname'] = ['like', "%$keyword%"];
}
$time = time();
$status = empty($param['status']) ? '' : $param['status'];
if (!empty($status)) {
$where['a_a.status'] = ['eq', "%$status%"];
if(!empty($status)){//0为全部1为托管中2为即将到期3为未托管
if($param['status'] == 1){
$where['o.status'] = ['eq',1];
$where['o.order_about_time'] = ['>',$time];
$whereor = "o.status = 3 and o.order_about_time > $time";
}else if($param['status'] == 2){
$where['o.status'] = ['eq',3];
$where['c.insurer'] = ['eq',$param['insurer']];
$where['o.order_about_time'] = ['<',$time];
$where['o.order_expire_time'] = ['>',$time];
// $whereor = "o.status = 3 and o.order_about_time < $time";
}else if($param['status'] == 3){
$where['o.status'] = ['eq',2];
$where['c.insurer'] = ['eq',$param['insurer']];
$whereor = "o.status = 3 and o.order_expire_time < $time";
}
}
$field = "c.*,i_c.thumbnail,i_c.insurance_company_name,o.order_expire_time,o.order_about_time,o.status,o.id o_id,o.pay_time,o.num";
$data= Db::name('order_info')
... ... @@ -47,6 +63,7 @@ class OrderController extends AdminBaseController
->join('cmf_insurance_company i_c','c.insurance_company_id = i_c.id')
->where('c.delete_time',0)
->where($where)
->where($whereor)
->order('o.create_time desc')
->paginate(10);
$data->appends($param);
... ...
... ... @@ -9,9 +9,9 @@
状态:
<select class="form-control" name="status">
<option value="0" <if condition="$status eq 0">selected</if>>全部</option>
<option value="1" <if condition="$status eq 1">selected</if>>未托管</option>
<option value="2" <if condition="$status eq 2">selected</if>>已托管</option>
<option value="3" <if condition="$status eq 3">selected</if>>即将到期</option>
<option value="1" <if condition="$status eq 1">selected</if>>托管中</option>
<option value="2" <if condition="$status eq 2">selected</if>>即将到期</option>
<option value="3" <if condition="$status eq 3">selected</if>>未托管</option>
</select> &nbsp;&nbsp;
关键字:
<input type="text" class="form-control" name="keyword" style="width: 150px;" value="{$keyword|default=''}" placeholder="请输入关键字...">
... ...