update order change process

This commit is contained in:
Tokumeikoi
2020-02-17 01:31:39 +08:00
parent 874648a4c0
commit a0a5327f42
3 changed files with 8 additions and 1 deletions

View File

@ -143,6 +143,7 @@ class OrderController extends Controller
$order->type = 3;
$order->surplus_amount = $this->getSurplusValue($user);
if ($order->surplus_amount >= $order->total_amount) {
$order->refund_amount = $order->surplus_amount - $order->total_amount;
$order->total_amount = 0;
} else {
$order->total_amount = $order->total_amount - $order->surplus_amount;