From a29faa3b47ba59386ec6d23de92e5d534c495961 Mon Sep 17 00:00:00 2001 From: li Date: Sat, 14 Mar 2026 23:21:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20client=20service/complaints=20500=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/Http/Controllers/Client/ComplaintController.php | 4 ++-- backend/app/Http/Controllers/Client/ServiceController.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/app/Http/Controllers/Client/ComplaintController.php b/backend/app/Http/Controllers/Client/ComplaintController.php index a40cd7a..5fbb53b 100644 --- a/backend/app/Http/Controllers/Client/ComplaintController.php +++ b/backend/app/Http/Controllers/Client/ComplaintController.php @@ -35,7 +35,7 @@ class ComplaintController extends Controller $customer = $request->user(); $validated = $request->validate([ - 'type' => 'required|string|max:50', + 'type' => 'required|integer|in:1,2,3,4', 'content' => 'required|string|max:1000', 'images' => 'nullable|array', 'images.*' => 'nullable|string|max:500', @@ -44,7 +44,7 @@ class ComplaintController extends Controller $complaint = Complaint::create([ 'customer_id' => $customer->id, 'store_id' => $customer->store_id, - 'type' => $validated['type'], + 'type' => (int) $validated['type'], 'content' => $validated['content'], 'images' => $validated['images'] ?? null, 'status' => 1, diff --git a/backend/app/Http/Controllers/Client/ServiceController.php b/backend/app/Http/Controllers/Client/ServiceController.php index 24518a8..0e48f5d 100644 --- a/backend/app/Http/Controllers/Client/ServiceController.php +++ b/backend/app/Http/Controllers/Client/ServiceController.php @@ -20,8 +20,7 @@ class ServiceController extends Controller $customer = $request->user(); $query = ServiceOrder::withoutGlobalScope('store') - ->where('customer_id', $customer->id) - ->with('package:id,name', 'item:id,name'); + ->where('customer_id', $customer->id); if ($request->filled('status')) { $query->where('status', (int) $request->input('status'));