diff --git a/.env.example b/.env.example index 3f90b95a..ed75c517 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,7 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost -APP_TIMEZONE=RPC +APP_TIMEZONE=PRC LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null diff --git a/beike/Admin/Http/Requests/CustomerGroupRequest.php b/beike/Admin/Http/Requests/CustomerGroupRequest.php index 85daa628..b3204732 100644 --- a/beike/Admin/Http/Requests/CustomerGroupRequest.php +++ b/beike/Admin/Http/Requests/CustomerGroupRequest.php @@ -33,7 +33,7 @@ class CustomerGroupRequest extends FormRequest public function rules() { return [ - 'descriptions.*.name' => 'required|max:64', + 'name.*' => 'required|max:64', 'level' => 'required|max:16', ]; } diff --git a/beike/Admin/Services/CustomerGroupService.php b/beike/Admin/Services/CustomerGroupService.php index eaa2d294..e706f86e 100644 --- a/beike/Admin/Services/CustomerGroupService.php +++ b/beike/Admin/Services/CustomerGroupService.php @@ -60,10 +60,10 @@ class CustomerGroupService { $descriptions = []; foreach ($data['name'] as $locale => $value) { - $descriptions[$locale]['name'] = $value; - } - foreach ($data['description'] as $locale => $value) { - $descriptions[$locale]['description'] = $value; + $descriptions[$locale] = [ + 'name' => $value, + 'description' => $data['description'][$locale] ?? '' + ]; } $params = [