/** * faq分类管理 */ public function actionPlayerKindIndex() { $this->_modelPlayerFaqKeywords = $this->_getGlobalData('Model_PlayerFaqKeywords', 'object'); switch ($_GET['doaction']) { case 'keywords': //关键字 $data = $this->_modelPlayerFaqKeywords->add($_POST); $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href']); break; default: $dataList = array(); foreach ($this->_faqKind as $key => $value) { $childList = $this->_modelPlayerKindFaq->findByGameTypeId($key); if (count($childList)) { foreach ($childList as &$childValue) { $childValue['url_edit'] = Tools::url(CONTROL, 'PlayerKindEdit', array('Id' => $childValue['Id'])); $childValue['url_del'] = Tools::url(CONTROL, 'PlayerKindDel', array('Id' => $childValue['Id'])); } } $dataList[] = array('game_type' => $value, 'game_type_id' => $key, 'url_add' => Tools::url(CONTROL, 'PlayerKindAdd', array('game_type_id' => $key)), 'childList' => $childList ? $childList : null); } $this->_view->assign('js', $this->_view->get_curJs()); $this->_view->assign('dataList', $dataList); $this->_view->assign('keywords', $this->_modelPlayerFaqKeywords->findAll()); $this->_utilMsg->createNavBar(); $this->_view->display(); break; } }
private function _kindIndex() { $this->_modelPlayerFaqKeywords = $this->_getGlobalData('Model_PlayerFaqKeywords', 'object'); $dataList = array(); foreach ($this->_faqKind as $key => $value) { $childList = $this->_modelPlayerKindFaq->findByGameTypeId($key, $_REQUEST['lang']); if (count($childList)) { foreach ($childList as &$childValue) { $childValue['url_edit'] = Tools::url(CONTROL, 'PlayerKind', array('Id' => $childValue['Id'], 'doaction' => 'edit', 'lang' => $_REQUEST['lang'])); $childValue['url_del'] = Tools::url(CONTROL, 'PlayerKind', array('Id' => $childValue['Id'], 'doaction' => 'del', 'lang' => $_REQUEST['lang'])); $childValue['url_recount'] = Tools::url(CONTROL, 'PlayerKind', array('Id' => $childValue['Id'], 'doaction' => 'recount')); $childValue['url_faq_copy_type'] = Tools::url(CONTROL, 'FaqCopy', array('Id' => $childValue['Id'], 'doaction' => 'faqtype')); } } $dataList[] = array('game_type' => $value, 'game_type_id' => $key, 'url_add' => Tools::url(CONTROL, 'PlayerKind', array('game_type_id' => $key, 'doaction' => 'add', 'lang' => $_REQUEST['lang'])), 'url_faq_copy_game' => Tools::url(CONTROL, 'FaqCopy', array('game_type_id' => $key, 'doaction' => 'game', 'lang' => $_REQUEST['lang'])), 'childList' => $childList ? $childList : null); } $this->_view->assign('dataList', $dataList); $this->_view->assign('keywords', $this->_modelPlayerFaqKeywords->findAll()); $this->_view->set_tpl(array('body' => 'Faq/PlayerKindIndex.html')); $this->_utilMsg->createNavBar(); $this->_view->display(); }