From 083d192cde19df1211bce3b3ec8551899ef48c35 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 22 Oct 2024 16:52:55 +0800 Subject: [PATCH] 1 --- webapp/controller/BaseAuthedController.class.php | 3 ++- webapp/controller/UserController.class.php | 6 ++++-- webapp/models/User.php | 12 +----------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index b60c7e65..af8ff70c 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -937,7 +937,8 @@ class BaseAuthedController extends BaseController { public function _getVipRightsVal($type) { - $vip = User::getVipLv(myself()->_getAddress()); + $details = \services\StakingVipService::getDetails(myself()->_getAddress()); + $vip = $details['lv']; return myself()->_callMtStatic('StakingVip', 'getValByLv', $vip, $type); } } diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 209b5082..0b76d5ea 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -29,6 +29,7 @@ require_once('services/NameService.php'); require_once('services/ChipPageService.php'); require_once('services/LogService.php'); require_once('services/NftService.php'); +require_once('services/StakingVipService.php'); use phpcommon\SqlHelper; use models\User; @@ -1163,10 +1164,11 @@ class UserController extends BaseAuthedController { public function getUserVip(){ + $details = \services\StakingVipService::getDetails(myself()->_getAddress()); $this->_rspData( array( - 'vip' => User::getVipLv(myself()->_getAddress()), - 'exp' => 0, + 'vip' => $details['lv'], + 'exp' => $details['cur'], ) ); } diff --git a/webapp/models/User.php b/webapp/models/User.php index f660eed7..254cb6c7 100644 --- a/webapp/models/User.php +++ b/webapp/models/User.php @@ -70,17 +70,7 @@ class User extends BaseModel { ); return $rows ? $rows : null; } - - public static function getVipLv($address){ - $row = SqlHelper::ormSelectOne( - myself()->_getMarketMysql(''), - 't_staking_cec', - array( - 'account_address' => $address - ) - ); - return $row ? $row['vip_lv'] : 0; - } + public static function show($row) {