add user discount

This commit is contained in:
Tokumeikoi 2020-02-14 21:54:16 +08:00
parent d356722482
commit d845439f14

View File

@ -148,6 +148,10 @@ class OrderController extends Controller
}
}
}
// user only discount
if ($user->discount) {
$order->total_amount = $order->total_amount * ($user->discount / 100);
}
// free process
if ($order->total_amount <= 0) {
$order->total_amount = 0;