1
This commit is contained in:
parent
2a4afc8e6c
commit
06c2d45f41
@ -469,6 +469,7 @@ class ShopController extends BaseAuthedController {
|
||||
|
||||
private function getInAppBalance()
|
||||
{
|
||||
$totalAmount = InAppRecord::getTotalAmount();
|
||||
$recordDb = InAppRecord::get();
|
||||
$upLimit = mt\Parameter::getVal('inapp_daily_up_limit', 0);
|
||||
$todayAmount = 0;
|
||||
|
@ -20,6 +20,22 @@ class InAppRecord extends BaseModel {
|
||||
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)
|
||||
{
|
||||
SqlHelper::upsert(
|
||||
|
Loading…
x
Reference in New Issue
Block a user