From 8521df0fa603fdb9e8d8899524c7866b8a64a5a9 Mon Sep 17 00:00:00 2001 From: yangduo Date: Thu, 16 Jan 2025 18:32:09 +0800 Subject: [PATCH] 1 --- webapp/classes/Privilege.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/webapp/classes/Privilege.php b/webapp/classes/Privilege.php index e08014a..b5c035d 100644 --- a/webapp/classes/Privilege.php +++ b/webapp/classes/Privilege.php @@ -4,6 +4,7 @@ namespace classes; use phpcommon; use metatable; + require_once 'metatable/privilegecard.php'; class Privilege @@ -24,7 +25,7 @@ class Privilege public function getBattlePlus($account_id) { - return 0;//$this->getPrivilegePlus($account_id, 'battleplus'); + return 0; //$this->getPrivilegePlus($account_id, 'battleplus'); } public function getCoinTimesPlus($account_id) @@ -45,16 +46,19 @@ class Privilege ':accountid' => $account_id, ) ); + + if (!$row || $row['vip_info'] == NULL) { + return 0; + } + $plus = 0; - if ($row) { - $nowtime = time(); - $vip_info = json_decode($row['vip_info'], true); - foreach ($vip_info as $carditem) { - if ($carditem['expire'] == 0 || $carditem['expire'] > $nowtime) { - $privilegecard_conf = metatable\getPrivilegeCardById($carditem['id']); - if (!$privilegecard_conf) { - $plus += $privilegecard_conf[$name]; - } + $nowtime = time(); + $vip_info = json_decode($row['vip_info'], true); + foreach ($vip_info as $carditem) { + if ($carditem['expire'] == 0 || $carditem['expire'] > $nowtime) { + $privilegecard_conf = metatable\getPrivilegeCardById($carditem['id']); + if (!$privilegecard_conf) { + $plus += $privilegecard_conf[$name]; } } }