From 980ac0ca8571ab3f5ce1b106a4ccc2cdab8dcfb8 Mon Sep 17 00:00:00 2001 From: hujiabin Date: Wed, 16 Nov 2022 19:59:09 +0800 Subject: [PATCH] 1 --- webapp/controller/BaseController.class.php | 9 +++++---- webapp/controller/EventRankingController.class.php | 6 +----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index afedba20..61599f7f 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -6,6 +6,7 @@ class BaseController { private $nowtime = 0; private $marketDbConn = null; + private $relationDbConn = null; function __construct() { @@ -126,18 +127,18 @@ class BaseController { public function _getRelationDbMysql() { - if ($this->marketDbConn) { - return $this->marketDbConn; + if ($this->relationDbConn) { + return $this->relationDbConn; } $mysql_conf = getMarketMysqlConfig(crc32('')); - $this->marketDbConn = new phpcommon\Mysql(array( + $this->relationDbConn = new phpcommon\Mysql(array( 'host' => $mysql_conf['host'], 'port' => $mysql_conf['port'], 'user' => $mysql_conf['user'], 'passwd' => $mysql_conf['passwd'], 'dbname' => getXVal($mysql_conf, 'dbname', 'relationdb1') )); - return $this->marketDbConn; + return $this->relationDbConn; } diff --git a/webapp/controller/EventRankingController.class.php b/webapp/controller/EventRankingController.class.php index 8a4cb0ec..b6e8e8e3 100644 --- a/webapp/controller/EventRankingController.class.php +++ b/webapp/controller/EventRankingController.class.php @@ -166,14 +166,10 @@ class EventRankingController extends BaseAuthedController foreach ($rows as $row) { $ranked += 1; - -// $guildDb = null; if (!$userInfo['guild_id']){ $this->myRanked['guild'] = array(); - error_log('*********************************************************'); - error_log(json_encode($this->myRanked)); } - $guildDb = null; + $guildDb = Guild::find($userInfo['guild_id']); if($userInfo['guild_id'] && $userInfo['guild_id'] == $row['guild_id']){ // $guildDb = Guild::find($row['guild_id']); $this->myRanked['ranked'] = $ranked;