/**
  * 增加游戏,运营商索引
  */
 private function _vipAdd()
 {
     if (count($_POST['operator_ids']) && isset($_POST['game_type'])) {
         $this->_modelGameOperator = $this->_getGlobalData('Model_GameOperator', 'object');
         $vipSetup = serialize(array('vip_timeout' => array(70, 60, 50, 40, 30, 10, 5), 'vip_pay' => array(0, 1000, 2000, 3000, 4000, 5000, 6000)));
         //默认的vipsetup
         foreach ($_POST['operator_ids'] as $value) {
             $this->_modelGameOperator->add(array('game_type_id' => $_POST['game_type'], 'operator_id' => $value, 'vip_setup' => $vipSetup));
         }
         $this->_modelGameOperator->createCache();
         $this->_utilMsg->showMsg(false);
     } else {
         $this->_utilMsg->showMsg('添加索引失败', -2);
     }
 }
 private function _gameOperatorEdit()
 {
     $this->_modelGameOperator = $this->_getGlobalData('Model_GameOperator', 'object');
     $Id = intval($_GET['Id']);
     if (!$Id) {
         $this->_utilMsg->showMsg('ID错误');
     }
     if ($this->_isPost()) {
         $vipSetup = array('vip_timeout' => explode(',', $_POST['vip_timeout']), 'vip_pay' => explode(',', $_POST['vip_pay']));
         $addData = array('url' => trim($_POST['url']), 'vip_setup' => serialize($vipSetup));
         if ($_POST['ext']) {
             $addData['ext'] = serialize($_POST['ext']);
         }
         $this->_modelGameOperator->update($addData, 'Id=' . $Id);
         $this->_modelGameOperator->createCache();
         $this->_utilMsg->showMsg(false, 1, Tools::url(CONTROL, 'Vip'));
     } else {
         $data = $this->_modelGameOperator->findById($Id);
         $this->_view->assign('inputData', $this->_getOperatorExtParam($data['game_type_id']));
         $gameTypeList = $this->_getGlobalData('game_type');
         $data['game_type'] = $gameTypeList[$data['game_type_id']]['name'];
         $operatorList = $this->_getGlobalData('operator_list');
         $data['operator_id'] = $operatorList[$data['operator_id']]['operator_name'];
         $vipSetup = unserialize($data['vip_setup']);
         unset($data['vip_setup']);
         $data['vip_timeout'] = implode(',', $vipSetup['vip_timeout']);
         $data['vip_pay'] = implode(',', $vipSetup['vip_pay']);
         if ($data['ext']) {
             $data['ext'] = unserialize($data['ext']);
         }
         $this->_view->assign('dataObject', $data);
         $this->_view->assign('isAdd', false);
         $this->_view->set_tpl(array('body' => 'GameOperator/EditGameOperator.html'));
         $this->_utilMsg->createNavBar();
         $this->_view->display();
     }
 }