From e068fccbb99225baa3551be07b2a0e084bc193e1 Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Fri, 15 Nov 2019 17:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=8E=BB?= =?UTF-8?q?=E5=B9=B4=E9=99=A9=E7=A7=8D=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/config/params.php | 1 + frontend/controllers/CarController.php | 29 ++++++++++++++++++++++++++ frontend/views/car/order-add.php | 11 ++++++++++ 3 files changed, 41 insertions(+) diff --git a/frontend/config/params.php b/frontend/config/params.php index 3df22ce..071beaa 100644 --- a/frontend/config/params.php +++ b/frontend/config/params.php @@ -7,5 +7,6 @@ return [ 'sms_url' => 'http://user.banmacar.com/api/sms/single-send', 'myinfo_url' => 'http://user.banmacar.com/api/user/myinfo', 'search_car_url' => 'http://user.banmacar.com/api/car/search-car', + 'car_info_url' => 'http://user.banmacar.com/api/car/car-info' ], ]; diff --git a/frontend/controllers/CarController.php b/frontend/controllers/CarController.php index 2441ced..9c860f5 100644 --- a/frontend/controllers/CarController.php +++ b/frontend/controllers/CarController.php @@ -530,6 +530,35 @@ class CarController extends BaseController return MyLib::error3('车辆信息不存在'); } + public function actionBihuCarinfo() + { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $id = $request->get('id',0); + $car_info = CarT::findOne(['id'=>$id]); + if($car_info) { + $url = Yii::$app->params['userPanel']['search_car_url']; + $token = Yii::$app->params['userPanel']['token']; + $params = [ + 'token' => $token, + 'LicenseNo' => $car_info->car_no, + 'EngineNo' => $car_info->engine_no, + 'CarVin' => $car_info->car_frame_no, + ]; + $client = new Client(['timeout'=> 120]); + $res = $client->request('POST', $url, [ + 'form_params' => $params, + 'http_errors' => false, + ]); + if($res->getStatusCode() == 200) { + $obj = json_decode($res->getBody()); + return MyLib::ok3($obj->data); + } + return MyLib::error3($res->getBody()); + } + return MyLib::error3('车辆信息不存在'); + } + public function actionInfo() { $request = Yii::$app->request; diff --git a/frontend/views/car/order-add.php b/frontend/views/car/order-add.php index 922a763..81dfc12 100644 --- a/frontend/views/car/order-add.php +++ b/frontend/views/car/order-add.php @@ -128,6 +128,11 @@ use common\models\PriceT;
@@ -339,6 +344,12 @@ use common\models\PriceT;