/**
  * faq评价
  */
 public function actionEvaluate()
 {
     $this->_modelPlayerFaqLog = $this->_getGlobalData('Model_PlayerFaqLog', 'object');
     $id = abs(intval($_REQUEST['id']));
     $this->_cacheFaq = $this->_getGlobalData('Cache_Faq', 'object');
     $faq = $this->_cacheFaq->getId($id);
     if (!$faq) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'faq error', 'data' => null));
         return;
     }
     $addArr = array();
     $addArr['game_type_id'] = $faq['game_type_id'];
     $addArr['lang_id'] = $faq['lang_id'];
     $addArr['source'] = 2;
     $addArr['date_create'] = CURRENT_TIME;
     $addArr['player_faq_id'] = $id;
     $addArr['faq_whether'] = abs(intval($_REQUEST['faq_whether']));
     if ($addArr['faq_whether'] == 0) {
         $addArr['faq_opinion'] = abs(intval($_REQUEST['faq_opinion']));
         if ($addArr['faq_opinion'] == 0) {
             $addArr['faq_opinion'] = rand(1, 4);
         }
         if ($addArr['faq_opinion'] == 5) {
             $addArr['content'] = $_REQUEST['content'];
         }
     }
     if ($this->_modelPlayerFaqLog->add($addArr)) {
         $this->_returnAjaxJson(array('status' => 1, 'info' => 'InterfaceFaq_Evaluate', 'data' => null));
     } else {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'insert error', 'data' => null));
     }
 }
Beispiel #2
0
 /**
  * 评价统计
  */
 public function actionEv()
 {
     $gameTypes = $this->_getGlobalData('game_type');
     $gameTypes = Model::getTtwoArrConvertOneArr($gameTypes, 'Id', 'name');
     $sources = array('1' => '官网', '2' => '游戏');
     $selected = array();
     //选中数组
     $selected['lang'] = $_POST['lang'];
     $selected['source'] = Tools::coerceInt($_POST['source']);
     $selected['start_time'] = $_POST['start_time'];
     $selected['end_time'] = $_POST['end_time'];
     $selected['game_type_id'] = Tools::coerceInt($_POST['game_type_id']);
     if ($this->_isPost()) {
         $this->_modelPlayerFaqLog = $this->_getGlobalData('Model_PlayerFaqLog', 'object');
         if (empty($_POST['start_time']) || empty($_POST['end_time'])) {
             $this->_utilMsg->showMsg('请选择开始时间与结束时间', -1, 2);
         }
         $stats = $this->_modelPlayerFaqLog->stats($_POST['source'], $_POST['game_type_id'], array('start' => $_POST['start_time'], 'end' => $_POST['end_time']), $_POST['lang']);
     }
     $this->_view->assign('dataList', $stats);
     $sources[''] = '所有';
     $gameTypes[''] = '所有';
     $lang = $this->_getGlobalData('lang');
     //语言
     $this->_view->assign('land', $lang);
     $this->_view->assign('sources', $sources);
     $this->_view->assign('gameTypes', $gameTypes);
     $this->_view->assign('selected', $selected);
     $this->_utilMsg->createPackageNavBar();
     if ($_POST['xls']) {
         //导出excel
         Tools::import('Util_ExportExcel');
         $this->_utilExportExcel = new Util_ExportExcel('faq统计', 'Excel/StatsFaq', $stats);
         $this->_utilExportExcel->outPutExcel();
     } else {
         $this->_view->display();
     }
 }
 /**
  * faq评价
  */
 public function actionEvaluate()
 {
     $this->_modelPlayerFaqLog = $this->_getGlobalData('Model_PlayerFaqLog', 'object');
     $addArr = array();
     $addArr['date_create'] = CURRENT_TIME;
     $id = abs(intval($_POST['id']));
     $addArr['player_faq_id'] = $id;
     $addArr['faq_whether'] = abs(intval($_POST['faq_whether']));
     if ($addArr['faq_whether'] == 0) {
         $addArr['faq_opinion'] = abs(intval($_POST['faq_opinion']));
         if ($addArr['faq_opinion'] == 5) {
             $addArr['content'] = $_POST['content'];
         }
     }
     if ($this->_modelPlayerFaqLog->add($addArr)) {
         $this->_returnAjaxJson(array('status' => 1, 'info' => null, 'data' => null));
     } else {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'insert error', 'data' => null));
     }
 }