diff --git a/app/Request/UserRequest.php b/app/Request/UserRequest.php index 984ef5c..b8cd5c9 100644 --- a/app/Request/UserRequest.php +++ b/app/Request/UserRequest.php @@ -64,7 +64,7 @@ class UserRequest extends FormRequest 'consignee_name' => 'required', 'consignee_tel' => 'required', 'is_default' => ['required','numeric','min:0','max:1'], - 'tag' => ['required','numeric','min:1','max:3'], + 'tag' => ['sometimes','required','numeric','min:1','max:4'], ]; } diff --git a/app/Services/UserService.php b/app/Services/UserService.php index d3c8e3f..cc45c90 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -367,7 +367,7 @@ class UserService extends BaseService $data['consignee_tel'] = $request_params['consignee_tel']; $data['consignee_tel_mask'] = Mask::maskPhoneStr($request_params['consignee_tel']); $data['is_default'] = $request_params['is_default']; - $data['tag'] = $request_params['tag']; + $data['tag'] = $request_params['tag'] ?? ""; $user_ship_address = UserShipAddress::addUserShipAddress($data); if (empty($user_ship_address)) { Db::rollBack();