优化代码

dev
曾超新 5 years ago
parent 9740a8cf7f
commit 6f14ece1c8
  1. 8
      frontend/controllers/DatabaseController.php

@ -519,7 +519,7 @@ class DatabaseController extends BaseController
$query->andWhere('car_t.car_man like "'.$car_man.'"'); $query->andWhere('car_t.car_man like "'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query->andWhere('car_t.phone like "'.$phone.'"'); $query->andWhere('car_t.car_man_phone=:phone or car_t.id_man_phone=:phone',[':phone'=>$phone]);
} }
if($car_no != '') { if($car_no != '') {
if($car_no == '非京'){ if($car_no == '非京'){
@ -1073,7 +1073,7 @@ class DatabaseController extends BaseController
$query->andWhere('car_t.car_man like "'.$car_man.'"'); $query->andWhere('car_t.car_man like "'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query->andWhere('car_t.phone like "'.$phone.'"'); $query->andWhere('car_t.car_man_phone=:phone or car_t.id_man_phone=:phone',[':phone'=>$phone]);
} }
if($car_no != '') { if($car_no != '') {
$query->andWhere('car_t.car_no like "'.$car_no.'"'); $query->andWhere('car_t.car_no like "'.$car_no.'"');
@ -1756,7 +1756,7 @@ class DatabaseController extends BaseController
$query->andWhere('car_t.car_man="'.$car_man.'"'); $query->andWhere('car_t.car_man="'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query->andWhere('car_t.phone like "'.$phone.'"'); $query->andWhere('car_t.car_man_phone=:phone or car_t.id_man_phone=:phone',[':phone'=>$phone]);
} }
if($car_no != '') { if($car_no != '') {
$query->andWhere('car_t.car_no like "'.$car_no.'"'); $query->andWhere('car_t.car_no like "'.$car_no.'"');
@ -2318,7 +2318,7 @@ class DatabaseController extends BaseController
$query->andWhere('car_t.car_man="'.$car_man.'"'); $query->andWhere('car_t.car_man="'.$car_man.'"');
} }
if($phone != '') { if($phone != '') {
$query->andWhere('car_t.phone="'.$phone.'"'); $query->andWhere('car_t.car_man_phone=:phone or car_t.id_man_phone=:phone',[':phone'=>$phone]);
} }
if($car_no != '') { if($car_no != '') {
$query->andWhere('car_t.car_no="'.$car_no.'"'); $query->andWhere('car_t.car_no="'.$car_no.'"');

Loading…
Cancel
Save