This commit is contained in:
aozhiwei 2024-08-08 13:19:52 +08:00
parent 728465f9b5
commit dccdde6aa4
3 changed files with 25 additions and 1 deletions

View File

@ -6,6 +6,7 @@ $g_conf_market_mysql_cluster = require('../config/game2006market.mysql.cluster.p
$g_conf_mysql_cluster = require('../config/game2006api.mysql.cluster.php');
$g_conf_relation_mysql_cluster = require('../config/game2006relation.mysql.cluster.php');
$g_conf_mail_mysql_cluster = require('../config/mail.mysql.cluster.php');
$g_conf_log_mysql_cluster = require('../config/log.mysql.cluster.php');
$g_conf_redis_cluster = require('../config/game2006api.redis.cluster.php');
$g_metatables = array();
@ -82,6 +83,12 @@ function getMailMysqlConfig()
return $g_conf_mail_mysql_cluster;
}
function getLogMysqlConfig()
{
global $g_conf_log_mysql_cluster;
return $g_conf_log_mysql_cluster;
}
function getServerSwitchConfig()
{
global $g_conf_server_switch_cluster;

View File

@ -9,6 +9,7 @@ class BaseController {
private $marketDbConn = null;
private $relationDbConn = null;
private $mailDbConn = null;
private $logDbConn = null;
private $timeOffset = 0;
private $moduleHash = array();
@ -191,6 +192,22 @@ class BaseController {
return $this->mailDbConn;
}
public function _getLogMysql()
{
if ($this->logDbConn) {
return $this->logDbConn;
}
$mysql_conf = getLogMysqlConfig();
$this->logDbConn = new phpcommon\Mysql(array(
'host' => $mysql_conf['host'],
'port' => $mysql_conf['port'],
'user' => $mysql_conf['user'],
'passwd' => $mysql_conf['passwd'],
'dbname' => $mysql_conf['dbname'],
));
return $this->logDbConn;
}
public function _getRelationDbMysql()
{
if ($this->relationDbConn) {

View File

@ -62,7 +62,7 @@ class LogService extends BaseService
'modifytime' => myself()->_getNowTime()
);
SqlHelper::insert(
myself()->_getMysql($accountId),
myself()->_getLogMysql(),
't_game_log',
$fieldsKv
);