/** * 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)); } }
/** * 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)); } }