From 8655dae204ee753842339aa745568a75d3a0653d Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Mon, 14 Oct 2024 16:41:29 +0800 Subject: [PATCH] 1 --- doc/User.py | 13 +++++++++++++ webapp/controller/UserController.class.php | 8 +++++++- webapp/models/User.php | 2 -- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/User.py b/doc/User.py index e423edd3..4a64a044 100644 --- a/doc/User.py +++ b/doc/User.py @@ -221,5 +221,18 @@ class User(object): _common.RspHead(), ['info',_common.UserInfo(), '用户信息'], ] + },{ + 'name': 'getUserVip', + 'desc': '用户VIP', + 'group': 'User', + 'url': 'webapp/index.php?c=User&a=getUserVip', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ['vip',0, 'vip等级'], + ['exp',0, 'vip经验'], + ] }, ] diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 39d36a9e..66792b60 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -1152,7 +1152,13 @@ class UserController extends BaseAuthedController { } } - public function getMyVip(){ + public function getUserVip(){ + $this->_rspData( + array( + 'vip' => User::getVipLv(myself()->_getAddress()), + 'exp' => 0, + ) + ); } } diff --git a/webapp/models/User.php b/webapp/models/User.php index 15267858..f660eed7 100644 --- a/webapp/models/User.php +++ b/webapp/models/User.php @@ -141,7 +141,6 @@ class User extends BaseModel { 'honor_info' => $honorInfo, 'account_lucky' => $lucky, 'chest_rate' => $rate, - 'vip_lv' => self::getVipLv($row['address']), ); } @@ -207,7 +206,6 @@ class User extends BaseModel { 'last_login_time' => $row['last_login_time'], 'account_lucky' => $lucky, 'chest_rate' => $rate, - 'vip_lv' => self::getVipLv($row['address']), ); }