This commit is contained in:
aozhiwei 2023-08-15 13:09:23 +08:00
parent 2a4afc8e6c
commit 06c2d45f41
2 changed files with 17 additions and 0 deletions

View File

@ -469,6 +469,7 @@ class ShopController extends BaseAuthedController {
private function getInAppBalance() private function getInAppBalance()
{ {
$totalAmount = InAppRecord::getTotalAmount();
$recordDb = InAppRecord::get(); $recordDb = InAppRecord::get();
$upLimit = mt\Parameter::getVal('inapp_daily_up_limit', 0); $upLimit = mt\Parameter::getVal('inapp_daily_up_limit', 0);
$todayAmount = 0; $todayAmount = 0;

View File

@ -20,6 +20,22 @@ class InAppRecord extends BaseModel {
return $row; return $row;
} }
public static function getTotalAmount()
{
$row = myself()->_getSelfMysql()->execQueryOne(
'SELECT SUM(amount_ok) AS total_amount FROM t_inapp_record WHERE account_id=:account_id',
array(
'account_id' => myself()->_getAccountId()
)
);
if ($row) {
if ($row['total_amount']) {
return $row['total_amount'];
}
}
return 0;
}
public static function addAmount($amount) public static function addAmount($amount)
{ {
SqlHelper::upsert( SqlHelper::upsert(