public function init()
 {
     parent::init();
     $this->_modelGames = $this->getGlobal('model/Games', 'Model_Games');
     $this->_games = $this->_modelGames->getAll();
     //所有游戏
     import('util/system/Type');
     $this->_status = Util_System_Type::getServersStatus();
     $this->_payStatus = Util_System_Type::getServersPayStatus();
     $this->assign('games', $this->_games);
 }
 public function createCache()
 {
     $this->_modelGames = $this->getGlobal('model/Games', 'Model_Games');
     $allGames = $this->_modelGames->getAll();
     $cachePath = config('PARAMS_PATH') . '/gameservers';
     if (!file_exists($cachePath)) {
         mkdir($cachePath, 0777, true);
     }
     foreach ($allGames as $key => $val) {
         $servers = $this->select("select * from {$this->tName()} where game_mark='{$val['mark']}'", 'id');
         if (count($servers)) {
             createPhpArr($servers, $cachePath . "/{$val['mark']}.conf.php");
         }
     }
 }
 public function cCreateCache()
 {
     $this->_modelGames = $this->getGlobal('model/Games', 'Model_Games');
     $this->_modelGames->createCache();
     $this->success('创建缓存成功', url('index/games/index'));
 }