From daa332818a73cbea0109b3b00cbde7e627c315a1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 14 Aug 2024 09:49:42 +0800 Subject: [PATCH] delete BC_CHANNEL code --- .../controller/BaseAuthedController.class.php | 8 ---- .../controller/TempToolsController.class.php | 38 ------------------- webapp/controller/UserController.class.php | 18 +++------ 3 files changed, 5 insertions(+), 59 deletions(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 2b3aacb2..67833f9f 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -146,14 +146,6 @@ class BaseAuthedController extends BaseController { } } $this->updateActive($r); - /*if (SERVER_ENV == _ONLINE) { - if (phpcommon\cmpVersion(getReqVal('_version', ''), '0.2.0') > 0) { - if (!$this->isWhiteList() || myself()->_getChannel() != BC_CHANNEL) { - phpcommon\sendError(1002, ''); - die(); - } - } - }*/ } protected function updateActive($r) diff --git a/webapp/controller/TempToolsController.class.php b/webapp/controller/TempToolsController.class.php index f99b3af5..0fd56f4c 100644 --- a/webapp/controller/TempToolsController.class.php +++ b/webapp/controller/TempToolsController.class.php @@ -236,8 +236,6 @@ class TempToolsController extends BaseController { $this->exportData2(); } else if($type == 3) { $this->exportData3(); - } else if($type == 4) { - $this->exportData4(); } } @@ -321,42 +319,6 @@ class TempToolsController extends BaseController { } } - public function exportData4() - { - $conn = myself()->_getMysql(''); - $rows = $conn->execQuery( - 'SELECT account_id, name FROM t_user', - array( - - ) - ); - $data = array(); - foreach ($rows as $row) { - $channel = phpcommon\extractChannel($row['account_id']); - if ($channel == BC_CHANNEL) { - $row2 = $conn->execQueryOne( - 'SELECT count(*) AS battle_times FROM t_battle_record WHERE account_id=:account_id', - array( - ':account_id' => $row['account_id'] - ) - ); - $data[$row['account_id']] = array( - 'account_id' => $row['account_id'], - 'name' => $row['name'], - 'battle_times' => $row2 ? $row2['battle_times'] : 0 - ); - } - } - echo 'account_id' . ",name,game_times\n"; - foreach ($data as $item) { - echo - $item['account_id'] . ',' - . $item['name'] . ',' - . $item['battle_times'] - . "\n"; - } - } - public function exportLock() { $beginTime = getReqVal('begin_time', '0'); diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 174808ae..75ddec41 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -65,14 +65,6 @@ class UserController extends BaseAuthedController { $this->_updateUserInfo(array( 'last_login_time'=>myself()->_getNowTime(), )); - if ($this->_getChannel() == BC_CHANNEL && - empty($userInfo['address']) - ) { - User::Update(array( - 'address' => $this->_getOpenId() - )); - $userInfo['address'] = $this->_getOpenId(); - } $this->_updateLastSeason($userInfo); $this->_updateSubUserAccount(); $this->_sign(); @@ -491,7 +483,7 @@ class UserController extends BaseAuthedController { 'name' => $name, ); if (SERVER_ENV == _ONLINE) { - $filter['channel'] = BC_CHANNEL; + $filter['channel'] = IMTBL_CHANNEL; } $userDb = SqlHelper::ormSelectOne ($this->_getMysql($name), @@ -503,7 +495,7 @@ class UserController extends BaseAuthedController { return; } $channel = phpcommon\extractChannel($userDb['account_id']); - if ($channel != BC_CHANNEL) { + if ($channel != IMTBL_CHANNEL) { if (SERVER_ENV == _ONLINE) { $this->_rspErr(1, 'not found'); return; @@ -1035,9 +1027,6 @@ class UserController extends BaseAuthedController { 'head_id' => 50001, 'head_list' => json_encode(array(50001)), ); - if ($this->_getChannel() == BC_CHANNEL) { - $fields['address'] = $this->_getOpenId(); - } $row = SqlHelper::ormSelectOne( myself()->_getAccountMysql(), 't_immutable_account', @@ -1051,6 +1040,9 @@ class UserController extends BaseAuthedController { $fields['is_gain_item'] = 1; } } + if ($row && !empty($row['email'])){ + $fields['email'] = $row['email']; + } SqlHelper::upsert ($this->_getSelfMysql(),