在A库搜索时,添加车辆使用性质条件

dev
曾超新 5 years ago
parent d91111d907
commit bd7153f41f
  1. 10
      frontend/controllers/DatabaseController.php
  2. 9
      frontend/views/database/a-index.php

@ -78,6 +78,7 @@ class DatabaseController extends BaseController
$no_insurerdate = $request->post('no_insurerdate');
$clean_right = $request->post('clean_right');
$biaozhu = $request->post('biaozhu');
$car_use_id = $request->post('car_use_id');
} else {
$car_man = $request->get('car_man');
$phone = $request->get('phone');
@ -104,6 +105,7 @@ class DatabaseController extends BaseController
$no_insurerdate = $request->get('no_insurerdate');
$clean_right = $request->get('clean_right');
$biaozhu = $request->get('biaozhu');
$car_use_id = $request->get('car_use_id');
}
$params = array();
$params['car_man'] = $car_man;
@ -131,6 +133,7 @@ class DatabaseController extends BaseController
$params['no_insurerdate'] = $no_insurerdate;
$params['clean_right'] = $clean_right;
$params['biaozhu'] = $biaozhu;
$params['car_use_id'] = $car_use_id;
$query = CarT::find();
@ -214,13 +217,18 @@ class DatabaseController extends BaseController
if($user1 != '') {
$query->andWhere('op_user1 like "'.$user1.'%"');
}
if($car_use_id > 0) {
$query->andWhere('car_use_id='.$car_use_id);
}
return ['query'=>$query,'params'=>$params];
}
//A库列表页
public function actionAIndex() {
$invalid_items = InvalidT::getTree();
$car_use_items = CarUseT::find()->all();
return $this->render('a-index',[
'invalid_items' => $invalid_items
'invalid_items' => $invalid_items,
'car_use_items' => $car_use_items
]);
}
//A库列表数据

@ -60,6 +60,15 @@ use \common\libs\MyLib;
<input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">使用性质</label>
<select name="car_use_id" id="car_use_id" class="form-control">
<option value="0">全部</option>
<?php foreach($car_use_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
} ?>
</select>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="b_lib">范围</label>
<div class="checkbox checkbox-inline">

Loading…
Cancel
Save