1
This commit is contained in:
parent
0b8c0874d4
commit
60278ced52
@ -366,10 +366,17 @@ class OtherController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getServerSwitch(){
|
public function getServerSwitch(){
|
||||||
|
$version = getReqVal('_version', 0);
|
||||||
|
$packageId = getReqVal('_packageid', 0);
|
||||||
|
$row = SqlHelper::ormSelectOne(myself()->_getConfDbMysql(), 't_audit',
|
||||||
|
array(
|
||||||
|
'model' => $packageId
|
||||||
|
));
|
||||||
|
$examining = !empty($row) && $row['version'] == $version && $row['is_auditing'] ? 1 : 0;
|
||||||
$switchObj = new ServerSwitch();
|
$switchObj = new ServerSwitch();
|
||||||
$con = $switchObj->getConfig();
|
$con = $switchObj->getGameSwitch();
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'data'=>$con
|
'data' => $examining ? $con['auditing'] : $con['normal']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,10 @@ use phpcommon\SqlHelper;
|
|||||||
|
|
||||||
class ServerSwitch {
|
class ServerSwitch {
|
||||||
const SERVER_SWITCH_KEY = 'server_switch_redis_key:';
|
const SERVER_SWITCH_KEY = 'server_switch_redis_key:';
|
||||||
|
const SERVER_AUDITING_KEY = 'server_auditing_redis_key:';
|
||||||
|
|
||||||
public function getConfig(){
|
public function getConfig(){
|
||||||
return $this->getGameSwitch();
|
return $this->getGameSwitch()['normal'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function heroChainIsOpen(){
|
public function heroChainIsOpen(){
|
||||||
@ -60,10 +61,14 @@ class ServerSwitch {
|
|||||||
|
|
||||||
private function selectSwitchTable(){
|
private function selectSwitchTable(){
|
||||||
$rows = SqlHelper::ormSelect(myself()->_getConfDbMysql(), 't_game_switch', array());
|
$rows = SqlHelper::ormSelect(myself()->_getConfDbMysql(), 't_game_switch', array());
|
||||||
$data = array();
|
$data = array(
|
||||||
|
'normal' => array(),
|
||||||
|
'auditing' => array(),
|
||||||
|
);
|
||||||
if (count($rows) > 0){
|
if (count($rows) > 0){
|
||||||
foreach ($rows as $row){
|
foreach ($rows as $row){
|
||||||
$data[$row['switch_name']] = $row['is_open'];
|
$data['normal'][$row['switch_name']] = $row['is_open'];
|
||||||
|
$data['auditing'][$row['switch_name']] = $row['audit_is_open'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user