diff --git a/beike/Shop/Http/Controllers/Account/RmaController.php b/beike/Shop/Http/Controllers/Account/RmaController.php index 63c2562f..0a39d062 100644 --- a/beike/Shop/Http/Controllers/Account/RmaController.php +++ b/beike/Shop/Http/Controllers/Account/RmaController.php @@ -59,10 +59,10 @@ class RmaController extends Controller return view('account/rmas/form', $data); } - public function store(RmaRequest $request): array + public function store(RmaRequest $request) { $rma = RmaService::createFromShop($request->only('order_product_id', 'quantity', 'opened', 'rma_reason_id', 'type', 'comment')); - return json_success('售后服务申请提交成功', $rma); + return redirect()->to(shop_route('account.rmas.index'))->with('success', '售后服务申请提交成功'); } } diff --git a/beike/Shop/Http/Requests/RmaRequest.php b/beike/Shop/Http/Requests/RmaRequest.php index b3ff468d..1d1a607c 100644 --- a/beike/Shop/Http/Requests/RmaRequest.php +++ b/beike/Shop/Http/Requests/RmaRequest.php @@ -33,9 +33,7 @@ class RmaRequest extends FormRequest public function rules() { $rules = [ - 'order_id' => 'required|exists:orders,id', 'order_product_id' => 'required|exists:order_products,id', - 'customer_id' => 'required|exists:customers,id', 'quantity' => 'required', 'opened' => 'required', 'rma_reason_id' => 'required|exists:rma_reasons,id', @@ -47,9 +45,7 @@ class RmaRequest extends FormRequest public function attributes() { return [ - 'order_id' => '订单', 'order_product_id' => '订单商品', - 'customer_id' => '顾客', 'quantity' => '数量', 'opened' => '已拆包装', 'rma_reason_id' => '退换货原因', diff --git a/themes/default/account/rmas/form.blade.php b/themes/default/account/rmas/form.blade.php index c28d4889..f1baaf9a 100644 --- a/themes/default/account/rmas/form.blade.php +++ b/themes/default/account/rmas/form.blade.php @@ -25,7 +25,6 @@
- {{--
商品信息
--}}
@@ -36,7 +35,7 @@
- {{--
商品信息 & 退换原因
--}} +
@csrf {{-- {{ method_field('put') }} --}} @@ -56,13 +55,15 @@ @endforeach
+
- + @if ($errors->has('quantity')) {{ $errors->first('quantity') }} @endif
+
+