From ec4c0ba3395b29c006eb81040cbf13adf0f76dd6 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 1 Jan 2020 18:00:45 +0800 Subject: [PATCH] update --- app/Http/Controllers/OrderController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index ec5ca361..96547faf 100755 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -116,12 +116,13 @@ class OrderController extends Controller if (isset($coupon)) { switch ($coupon->type) { case 1: $order->discount_amount = $order->total_amount - $coupon->value; - case 1: $order->discount_amount = $order->total_amount * ($coupon->value / 100); + case 2: $order->discount_amount = $order->total_amount * ($coupon->value / 100); } $order->total_amount = $order->total_amount - $order->discount_amount; } // free process if ($order->total_amount <= 0) { + $order->total_amount = 0; $order->status = 1; } if (!$order->save()) {