|
|
@ -63,6 +63,7 @@ use common\models\OrderAddress; |
|
|
|
use common\models\InvalidNew; |
|
|
|
use common\models\InvalidNew; |
|
|
|
use common\models\InvalidRenewal; |
|
|
|
use common\models\InvalidRenewal; |
|
|
|
use common\models\ZhongjiGiftT; |
|
|
|
use common\models\ZhongjiGiftT; |
|
|
|
|
|
|
|
use GuzzleHttp\Client; |
|
|
|
use Yii; |
|
|
|
use Yii; |
|
|
|
use yii\data\Pagination; |
|
|
|
use yii\data\Pagination; |
|
|
|
use yii\db\Exception; |
|
|
|
use yii\db\Exception; |
|
|
@ -503,6 +504,27 @@ class CarController extends BaseController |
|
|
|
$id = $request->get('id',0); |
|
|
|
$id = $request->get('id',0); |
|
|
|
|
|
|
|
|
|
|
|
$car_info = CarT::findOne(['id'=>$id]); |
|
|
|
$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 |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
if($car_info->car_man_number != '' && substr($car_info->car_man_number, -6) != '') { |
|
|
|
|
|
|
|
$params['SixDigitsAfterIdCard'] = substr($car_info->car_man_number, -6); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$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()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
$order_info = $car_info->getOrders()->orderBy('id DESC')->one(); |
|
|
|
$order_info = $car_info->getOrders()->orderBy('id DESC')->one(); |
|
|
|
if(!$order_info) { |
|
|
|
if(!$order_info) { |
|
|
|
$user_id = 0; |
|
|
|
$user_id = 0; |
|
|
|