From b228882e7c3eb4e653485fb5e8437ce5a8ce4cfa Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 15 Aug 2023 13:11:41 +0800 Subject: [PATCH] 1 --- webapp/controller/ShopController.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 269b1192..bf13b534 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -472,11 +472,14 @@ class ShopController extends BaseAuthedController { $totalAmount = InAppRecord::getTotalAmount(); $recordDb = InAppRecord::get(); $upLimit = mt\Parameter::getVal('inapp_daily_up_limit', 0); + $totalUpLimit = mt\Parameter::getVal('inapp_total_up_limit', 0); $todayAmount = 0; if ($recordDb) { $todayAmount = max($recordDb['amount'], $recordDb['amount_ok']); } - return max(0, $upLimit - $todayAmount); + $dailyBalance = max(0, $upLimit - $todayAmount); + $totalBalance = max(0, $totalUpLimit - $totalAmount); + return min($dailyBalance, $totalBalance); } }