|
@@ -253,7 +253,7 @@ class UserController
|
|
|
if (!isset($addressInfo['address']['district'])) return app('json')->fail('收货地址格式错误!');
|
|
|
if (!isset($addressInfo['address']['city_id']) && $addressInfo['type'] == 0) {
|
|
|
return app('json')->fail('收货地址格式错误!请重新选择!');
|
|
|
- } else if ($addressInfo['type'] == 1 && !$addressInfo['id']) {
|
|
|
+ } else if ($addressInfo['type'] == 1) {
|
|
|
$city = $addressInfo['address']['city'];
|
|
|
$cityId = SystemCity::where('name', $city)->where('parent_id', '<>', 0)->value('city_id');
|
|
|
if ($cityId) {
|
|
@@ -262,6 +262,7 @@ class UserController
|
|
|
if (!($cityId = SystemCity::where('parent_id', '<>', 0)->where('name', 'like', "%$city%")->value('city_id'))) {
|
|
|
return app('json')->fail('收货地址格式错误!修改后请重新导入!');
|
|
|
}
|
|
|
+ $addressInfo['address']['city_id'] = $cityId;
|
|
|
}
|
|
|
}
|
|
|
|