mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
update
This commit is contained in:
parent
b4e5eb26e3
commit
ec4c0ba339
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user