曾超新 5 years ago
parent 111e8be031
commit 132e157e9e
  1. 14
      frontend/controllers/CarController.php

@ -553,13 +553,17 @@ class CarController extends BaseController
]); ]);
if($res->getStatusCode() == 200) { if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody()); $obj = json_decode($res->getBody());
if($obj->data && $obj->data->UserInfo && $obj->data->UserInfo->CarUsedType != '') { if($obj->code == 200) {
$car_user_info = CarUseT::find()->where(['name'=>$obj->data->UserInfo->CarUsedType])->one(); if($obj->data && $obj->data->UserInfo && $obj->data->UserInfo->CarUsedType != '') {
if($car_user_info) { $car_user_info = CarUseT::find()->where(['name'=>$obj->data->UserInfo->CarUsedType])->one();
$obj->data->UserInfo->CarUsedType = $car_user_info->id; if($car_user_info) {
$obj->data->UserInfo->CarUsedType = $car_user_info->id;
}
} }
return MyLib::ok3($obj->data);
} else {
return MyLib::error3($obj->msg);
} }
return MyLib::ok3($obj->data);
} }
return MyLib::error3($res->getBody()); return MyLib::error3($res->getBody());
} }

Loading…
Cancel
Save