完成车主信息搜索

dev
曾超新 5 years ago
parent ddd4e9212b
commit 49ed13a465
  1. 2
      frontend/controllers/AppointmentController.php
  2. 42
      frontend/controllers/CarController.php
  3. 1
      frontend/controllers/DatabaseController.php
  4. 12
      frontend/controllers/GiftController.php
  5. 17
      frontend/controllers/RenewalController.php
  6. 924
      frontend/views/car/info-track.php
  7. 2
      frontend/views/car/search.php
  8. 2
      frontend/views/gift/ticket-use.php
  9. 20
      frontend/views/renewal/first.php
  10. 4
      frontend/web/assets/js/content.js

@ -312,7 +312,7 @@ class AppointmentController extends BaseController
$query->andWhere('car_t.car_man like "'.$car_man.'"');
}
if($phone != '') {
$query->andWhere('car_t.phone like "'.$phone.'"');
$query->andWhere('car_t.car_man_phone like "'.$phone.'"');
}
if($car_no != '') {
$query->andWhere('car_t.car_no like "'.$car_no.'"');

@ -978,7 +978,14 @@ class CarController extends BaseController
}
public function actionInfoTrack() {
return $this->render('info-track');
$request = Yii::$app->request;
$id = $request->get('id',0);
// 车辆信息
$car_info = CarT::findOne(['id'=>$id]);
return $this->render('info-track',[
'car_info' => $car_info
]);
}
public function actionInfoTrackJson()
@ -2379,6 +2386,7 @@ class CarController extends BaseController
$car_info->seats = $seats;
$car_info->register_date = $register_date;
$car_info->car_man = $car_man;
$car_info->car_man_number = $car_man_number;
$car_info->car_use_id = $car_use_id;
$car_info->engine_no = $engine_no;
@ -5040,7 +5048,7 @@ class CarController extends BaseController
$items = $query->all();
$data = [];
$data['total'] = count($items);
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
@ -5051,6 +5059,36 @@ class CarController extends BaseController
return $data;
}
public function actionOrderHistoryJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_id = $request->get('car_id');
$offset = $request->get('offset', 0);
$limit = $request->get('limit', 10);
$query = OrderT::find()
->where(['car_id'=>$car_id])
->andWhere('status_id>1')
->orderBy('id DESC');
$total = $query->count();
$query = $query->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$row['username'] = $row->user ? $row->user->getShowName():'';
$row['status'] = $row->status->name;
$data['rows'][] = $row;
}
return $data;
}
public function actionOrderAdd() {
$request = Yii::$app->request;
$car_id = $request->get('car_id');

@ -79,7 +79,6 @@ class DatabaseController extends BaseController
$clean_right = $request->post('clean_right');
$biaozhu = $request->post('biaozhu');
} else {
$car_man = $request->get('car_man');
$phone = $request->get('phone');
$car_no = $request->get('car_no');

@ -798,6 +798,7 @@ class GiftController extends \yii\web\Controller
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$code = $request->get('code');
$car_id = $request->get('car_id',0);
$car_no = $request->get('car_no');
$username = $request->get('username');
$s_begin_date = $request->get('s_begin_date');
@ -819,19 +820,22 @@ class GiftController extends \yii\web\Controller
->where('gift_t.type_id=2')
->orderBy('id DESC');
if($code != '') {
$query = $query->andWhere('gift_ticket_t_use.code="'.$code.'"');
$query->andWhere('gift_ticket_t_use.code="'.$code.'"');
}
if($car_id > 0) {
$query->andWhere('order_t.car_id='.$car_id);
}
if($car_no != '') {
$query = $query->andWhere('gift_ticket_t_use.car_no like "'.$car_no.'"');
$query->andWhere('gift_ticket_t_use.car_no like "'.$car_no.'"');
}
if($username != ''){
$user = UserT::find()->where('username="'.$username.'"')->andWhere('is_delete=0')->one();
$query = $query->andWhere('gift_ticket_t_use.op_id='.$user->id);
$query->andWhere('gift_ticket_t_use.op_id='.$user->id);
}
if($s_begin_date != ''){
$query = $query->andWhere('order_t.submit_date>="'.$s_begin_date.'"');
$query->andWhere('order_t.submit_date>="'.$s_begin_date.'"');
}
if($s_end_date != ''){
$query = $query->andWhere('order_t.submit_date<="'.$s_begin_date.'"');

@ -97,17 +97,15 @@ class RenewalController extends BaseController
$car_man = $request->get('car_man');
$phone = $request->get('phone');
$car_no = $request->get('car_no');
$page = $request->get('page',1);
$username = $request->get('username');
$sort_key = $request->get('sort_key','appointment_t.pdate');
$sort_value = $request->get('sort_value','ASC');
$user_id = $request->get('user_id');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=1 and car_t.location=2');
->where('appointment_t.is_first=1 and car_t.location=4');
if($username == '') {
$user_ids = $this->getChildrenUserIDs();
@ -118,7 +116,7 @@ class RenewalController extends BaseController
$query->andWhere('car_t.car_man like "'.$car_man.'"');
}
if($phone != '') {
$query->andWhere('car_t.phone like "'.$phone.'"');
$query->andWhere('car_t.car_man_phone like "'.$phone.'"');
}
if($car_no != '') {
$query->andWhere('car_t.car_no like "'.$car_no.'"');
@ -137,12 +135,11 @@ class RenewalController extends BaseController
$query->orderBy($sort_key.' '.$sort_value.',appointment_t.id '.$sort_value);
}
$sql = $query->createCommand()->rawSql;
// echo $query->createCommand()->rawSql;
$total = $query->count();
$session->remove('appointment_first');
$session->set('appointment_first',$sql);
$query = $query->offset($offset)->limit($limit);
$query->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
@ -189,7 +186,7 @@ class RenewalController extends BaseController
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=0 and car_t.location=2')
->where('appointment_t.is_first=0 and car_t.location=4')
->andWhere('appointment_t.pdate<="'.date('Y-m-d').'"');
$user_ids = $this->getChildrenUserIDs();
@ -199,7 +196,7 @@ class RenewalController extends BaseController
$query = $query->andWhere('car_t.car_man like "'.$car_man.'"');
}
if($phone != '') {
$query = $query->andWhere('car_t.phone="'.$phone.'"');
$query = $query->andWhere('car_t.car_man_phone="'.$phone.'"');
}
if($ptype > 0) {
$query = $query->andWhere('appointment_t.ptype='.$ptype);
@ -265,7 +262,7 @@ class RenewalController extends BaseController
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=0 and car_t.location=2');
->where('appointment_t.is_first=0 and car_t.location=4');
if($username == '') {
$user_ids = $this->getChildrenUserIDs();
@ -276,7 +273,7 @@ class RenewalController extends BaseController
$query = $query->andWhere('car_t.car_man like "'.$car_man.'"');
}
if($phone != '') {
$query = $query->andWhere('car_t.phone="'.$phone.'"');
$query = $query->andWhere('car_t.car_man_phone="'.$phone.'"');
}
if($ptype > 0) {
$query = $query->andWhere('appointment_t.ptype='.$ptype);

File diff suppressed because it is too large Load Diff

@ -90,7 +90,7 @@ use \common\libs\MyLib;
}
function info(id) {
layer_show('客户信息','/car/info-track?id=' + id);
window.open('/car/info-track?id=' + id);
}
function refreshList() {

@ -93,7 +93,7 @@ use \common\libs\MyLib;
<th data-field="input_date">发放日期</th>
<th data-field="end_date">有效期日期</th>
<th data-field="submit_user">提单人</th>
<th data-field="use_date">使用日期1</th>
<th data-field="use_date">使用日期</th>
<th data-field="status">状态</th>
<th data-field="username">操作员</th>
<th data-formatter="opFormatter">操作</th>

@ -17,17 +17,23 @@ use \common\libs\MyLib;
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<div class="form-group">
<label>车主</label>
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_man">车主</label>
<input type="text" name="car_man" id="car_man" class="form-control">
<label>电话</label>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="phone">电话</label>
<input type="text" name="phone" id="phone" class="form-control">
<label>车牌</label>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">车牌</label>
<input type="text" name="car_no" id="car_no" class="form-control">
<label>被保险人</label>
<input type="text" name="id_man" id="id_man" class="form-control">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">工号</label>
<input type="text" name="username" id="username" class="form-control">
</div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
</form>
<div class="row">
<div class="col-md-12">

@ -44,8 +44,8 @@ $('.close-link').click(function () {
//判断当前页面是否在iframe中
if (top == this) {
var gohome = '<div class="gohome"><a class="animated bounceInUp" href="index.html?v=4.0" title="返回首页"><i class="fa fa-home"></i></a></div>';
$('body').append(gohome);
// var gohome = '<div class="gohome"><a class="animated bounceInUp" href="index.html?v=4.0" title="返回首页"><i class="fa fa-home"></i></a></div>';
// $('body').append(gohome);
}
//animation.css

Loading…
Cancel
Save