Example #1
0
 /**
  * 更新faq点击率
  * @param array $postArr
  */
 public function ratioEdit($postArr)
 {
     if (!Tools::coerceInt($postArr['Id'])) {
         return array('msg' => '请选择正确的FAQ', 'status' => -1, 'href' => 1);
     }
     $ratio = Tools::coerceInt($postArr['ratio']);
     if ($this->update(array('ratio' => $ratio), "Id={$postArr['Id']}")) {
         return array('msg' => false, 'status' => 1, 'href' => 1);
     } else {
         return array('msg' => '更改失败', 'status' => -2, 'href' => 1);
     }
 }
 public function edit($postArr)
 {
     if (empty($postArr['Id'])) {
         return array('msg' => '参数错误', 'status' => -1, 'href' => 1);
     }
     $monthScorce = Tools::coerceInt($postArr['month_scorce']);
     $codeScorce = Tools::coerceInt($postArr['code_scorce']);
     $totalScorce = round($monthScorce * 0.8 + $codeScorce * 0.2);
     $updateArr = array('month_scorce' => $monthScorce, 'code_scorce' => $codeScorce, 'total_scorce' => $totalScorce);
     $this->update($updateArr, "Id={$postArr['Id']}");
     return array('msg' => '修改评分成功', 'status' => 1, 'href' => 2);
 }
 public function edit($postArr)
 {
     if (empty($postArr['Id'])) {
         return array('msg' => '参数错误', 'status' => -1, 'href' => 1);
     }
     $dataList = $this->findById($postArr['Id']);
     $qualityScorce = Tools::coerceInt($postArr['qulaity_scorce']);
     $efficiencyScorce = Tools::coerceInt($postArr['efficiency_scorce']);
     $activeScorce = Tools::coerceInt($postArr['active_scorce']);
     $innovationScorce = Tools::coerceInt($postArr['innovation_scorce']);
     $totalScorce = round($qualityScorce * 0.4 + $efficiencyScorce * 0.4 + $activeScorce * 0.1 + $innovationScorce * 0.1);
     $updateArr = array('qulaity_scorce' => $qualityScorce, 'efficiency_scorce' => $efficiencyScorce, 'active_scorce' => $activeScorce, 'innovation_scorce' => $innovationScorce, 'total_scorce' => $totalScorce);
     $this->update($updateArr, "Id={$postArr['Id']}");
     return array('msg' => '修改成功', 'status' => 1, 'href' => 2);
 }
Example #4
0
 /**
  * 富人国获取礼包卡号动作 
  * @todo 未完成...
  */
 public function getLibaoCard_2()
 {
     exit;
     if (!$_REQUEST['marking']) {
         return array('status' => 0, 'info' => null, 'data' => 'not params marking');
     }
     if (!$_REQUEST['card_id']) {
         return array('status' => 0, 'info' => null, 'data' => 'not params card_id');
     }
     $cardId = Tools::coerceInt($_REQUEST['card_id']);
     $serverMarking = strtoupper($_REQUEST['marking']);
     $this->_modelGameSerList = $this->_getGlobalData('Model_GameSerList', 'object');
     $serverDetail = $this->_modelGameSerList->findByMarking(2, self::MARKING . $serverMarking);
     $serverId = $serverDetail['Id'];
     $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object');
     $get = array('c' => 'Card', 'a' => 'Create', 'doaction' => 'save');
     $post = array('TypeId' => $cardId, 'cardbyte' => 32, 'Number' => 1, 'TimeLimit' => 0);
     $this->_utilApiFrg->addHttp($serverId, $get, $post);
     $this->_utilApiFrg->send();
     $data = $this->_utilApiFrg->getResult();
 }
Example #5
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();
     }
 }
 /**
  * sphinx工作状态
  * @return boolean
  */
 public function actionSphinxStatus()
 {
     $this->_utilFaqSearch = $this->_getGlobalData('Util_FaqSearch', 'object');
     $keyWords = $_REQUEST['keywords'];
     $gameTypeId = Tools::coerceInt(1);
     $page = Tools::coerceInt(1);
     if (!$page) {
         $page = 1;
     }
     $pageSize = Tools::coerceInt(8);
     if (!$pageSize) {
         $pageSize = 8;
     }
     $this->_utilFaqSearch->setFaqStatus(1);
     //设置不需要官网的
     $this->_utilFaqSearch->setLimit($page, $pageSize);
     $data = $this->_utilFaqSearch->search('赢在大亨', $gameTypeId, $this->_curLang);
     if (count($data['data'])) {
         echo 1;
     } else {
         echo 0;
     }
 }
Example #7
0
 public function actionIndex()
 {
     $users = $this->_getGlobalData('user_index_id');
     if ($this->_isPost()) {
         $auditType = $this->_getGlobalData('frg_audit_type');
         array_unshift($auditType, '汇总');
         if (empty($_POST['start_date']) || empty($_POST['end_date'])) {
             $this->_utilMsg->showMsg('请设置开始时间与结束时间', -1, 2);
         }
         if ($_POST['audit_user_id']) {
             $auditUserId = Tools::coerceInt($_POST['audit_user_id']);
         }
         $this->_modelApplyDataFrg = $this->_getGlobalData('Model_ApplyDataFrg', 'object');
         $time = array('start' => strtotime($_POST['start_date']), 'end' => strtotime($_POST['end_date']));
         $dataList = $this->_modelApplyDataFrg->stats($time, $auditUserId);
         $this->_view->assign('dataList', $dataList);
         $this->_view->assign('displayTrue', true);
         $this->_view->assign('auditType', $auditType);
     }
     $this->_view->assign('users', $users);
     $this->_utilMsg->createPackageNavBar();
     $this->_view->display();
 }
Example #8
0
 private function _documentDel()
 {
     $this->_modelQualityDocument = $this->_getGlobalData('Model_QualityDocument', 'object');
     $id = Tools::coerceInt($_GET['Id']);
     if ($this->_modelQualityDocument->delById($id)) {
         $this->_utilMsg->showMsg('删除成功');
     } else {
         $this->_utilMsg->showMsg('删除失败', -2);
     }
 }
Example #9
0
 /**
  * 更改状态
  */
 public function actionChangeStatus()
 {
     if ($this->_isAjax()) {
         $id = Tools::coerceInt($_GET['Id']);
         $status = Tools::coerceInt($_GET['status']);
         if ($this->_modelWorkOrder->update(array('status' => $status), "Id={$id}")) {
             $this->_returnAjaxJson(array('status' => 1, 'msg' => '更改状态成功'));
         } else {
             $this->_returnAjaxJson(array('status' => 0, 'msg' => '更改状态失败'));
         }
     }
 }
Example #10
0
 /**
  * 更改状态
  */
 public function actionChangeStatus()
 {
     if ($this->_isAjax()) {
         $id = Tools::coerceInt($_GET['Id']);
         $status = Tools::coerceInt($_GET['status']);
         if ($this->_modelWorkOrder->update(array('status' => $status), "Id={$id}")) {
             #------添加日志------#
             $this->_modelOrderLog = $this->_getGlobalData('Model_OrderLog', 'object');
             $this->_modelOrderLog->addLog(array('Id' => $id), Model_OrderLog::CHANGE_STATUS);
             #------添加日志------#
             $this->_returnAjaxJson(array('status' => 1, 'msg' => Tools::getLang('CHANGESTATUS_SUCCESS', __CLASS__)));
         } else {
             $this->_returnAjaxJson(array('status' => 0, 'msg' => Tools::getLang('CHANGESTATUS_ERROR', __CLASS__)));
         }
     }
 }
Example #11
0
 /**
  * 更改分数ajax
  */
 public function actionChanageScores()
 {
     if ($this->_isAjax()) {
         $scores = $_GET['scores'];
         $qaId = Tools::coerceInt($_GET['qa_id']);
         $this->_modelQuality = $this->_getGlobalData('Model_Quality', 'object');
         if ($this->_modelQuality->update(array('scores' => $scores), "qa_id={$qaId}")) {
             $this->_returnAjaxJson(array('status' => 1, 'msg' => '更改分数成功'));
         } else {
             $this->_returnAjaxJson(array('status' => 0, 'msg' => '更改分数失败'));
         }
     }
 }
Example #12
0
 /**
  * 用户权限分配 
  */
 private function _userAct()
 {
     if ($this->_isPost()) {
         $userId = $_POST['user_id'];
         $idArr = $_POST['Id'];
         if ($idArr) {
             $idArr = implode(',', $idArr);
         } else {
             $idArr = null;
         }
         $this->_modelUser->update(array('act' => $idArr), "Id={$userId}");
         $this->_utilMsg->showMsg('增加权限成功', 1, Tools::url(CONTROL, ACTION));
     } else {
         $moudlesUrl = $this->_getMoudlesUrl();
         $this->_view->assign('moudlesUrl', $moudlesUrl);
         #------获得菜单项一维数组------#
         $this->_modelMenu = $this->_getGlobalData('Model_Menu', 'object');
         $menuList = $this->_modelMenu->findAll();
         $menuArr = array();
         foreach ($menuList as $value) {
             $menuArr[$value['value']] = $value['name'];
         }
         #------获得菜单项一维数组------#
         $userId = Tools::coerceInt($_GET['user_id']);
         $this->_modelAct = $this->_getGlobalData('Model_Act', 'object');
         $dataList = $this->_modelAct->getUseRoleAct($userId);
         $controlList = array();
         $actionList = array();
         $selectedList = array();
         foreach ($dataList as &$value) {
             if ($value['selected']) {
                 $selectedList[$value['Id']] = $value['selected'];
             }
             if ($value['parent_id'] == 0) {
                 array_push($controlList, $value);
             } else {
                 array_push($actionList, $value);
             }
         }
         $checkBox = '';
         foreach ($controlList as $key => $value) {
             $checkBox .= '<tr><td align="left">';
             $checked = array_key_exists($value['Id'], $selectedList) ? 'checked="checked"' : '';
             if ($checked != '') {
                 if ($selectedList[$value['Id']] == 1) {
                     $checked .= " disabled='disabled'' ";
                 }
                 //如果等于1就表示这个选中的按钮是通过角色选中的
             }
             $checkBox .= "<input type='checkbox' value='{$value['value']}' name='Id[]' {$checked} /><b>{$menuArr[$value['value']]}.{$value['value']}</b><hr />";
             foreach ($actionList as $childValue) {
                 if ($childValue['parent_id'] == $value['Id']) {
                     $checked = array_key_exists($childValue['Id'], $selectedList) ? 'checked="checked"' : '';
                     if ($checked != '') {
                         if ($selectedList[$childValue['Id']] == 1) {
                             $checked .= " disabled='disabled'' ";
                         }
                         //如果等于1就表示这个选中的按钮是通过角色选中的
                     }
                     $checkBox .= "&nbsp;&nbsp;&nbsp;→<input type='checkbox' value='{$childValue['value']}' name='Id[]' {$checked} />{$menuArr[$childValue['value']]}.<a href='javascript:;' val_data='{$childValue['value']}' name='user_act'>{$childValue['value']}</a><br/>";
                 }
             }
             $checkBox .= '</td></tr>';
         }
         $this->_view->assign('checkBox', $checkBox);
         $this->_utilMsg->createNavBar();
         $this->_view->set_tpl(array('body' => 'User/UserAct.html'));
         $this->_view->display();
     }
 }
Example #13
0
 /**
  * 更新菜单子项
  */
 private function _update()
 {
     if ($this->_isAjax()) {
         if ($_POST['Id']) {
             $updateArr = array('sort' => Tools::coerceInt($_POST['sort']), 'super_action' => trim($_POST['super_action']), 'status' => Tools::coerceInt($_POST['status']), 'name' => $_POST['name'], 'name_2' => $_POST['name_2']);
             $id = Tools::coerceInt($_POST['Id']);
             if ($this->_modelMenu->update($updateArr, "Id={$id}")) {
                 $this->_returnAjaxJson(array('status' => 1, 'msg' => '更新成功'));
             } else {
                 $this->_returnAjaxJson(array('status' => -2, 'msg' => '更新失败'));
             }
         } else {
             $this->_utilMsg->showMsg(Tools::getLang('SELECT_ERROR', __CLASS__), -1);
         }
     }
 }
Example #14
0
 /**
  * 更新菜单子项
  */
 private function _update()
 {
     if ($this->_isPost()) {
         if ($_POST['Id']) {
             $updateArr = array('sort' => Tools::coerceInt($_POST['sort']), 'super_action' => trim($_POST['super_action']));
             $id = Tools::coerceInt($_POST['Id']);
             if ($this->_modelMenu->update($updateArr, "Id={$id}")) {
                 $this->_utilMsg->showMsg(false);
             } else {
                 $this->_utilMsg->showMsg('更新失败,请联系管理员', -2);
             }
         } else {
             $this->_utilMsg->showMsg('请选择您要更新的菜单', -1);
         }
     }
 }
Example #15
0
 /**
  * 更改语言
  */
 public function actionChangeLang()
 {
     $langId = Tools::coerceInt($_GET['lang']);
     if (!in_array($langId, array(1, 2))) {
         $langId = 1;
     }
     setcookie('kefu_lang', $langId, CURRENT_TIME + 60 * 60 * 6);
     $this->_utilMsg->showMsg(false);
 }
Example #16
0
 /**
  * 评率
  */
 private function _evaluation()
 {
     $id = Tools::coerceInt($_GET['Id']);
     $this->_modelFaqLog = $this->_getGlobalData('Model_FaqLog', 'object');
     $dataList = $this->_modelFaqLog->getFaqEvaluation($id);
     $dataList['good'] = $dataList['good'] ? $dataList['good'] : 0;
     $dataList['bad'] = $dataList['bad'] ? $dataList['bad'] : 0;
     if ($dataList['opinion']) {
         $faqOpinion = $this->_getGlobalData('faq_opinion');
         $faqOpinion = array_flip($faqOpinion);
         foreach ($faqOpinion as $key => &$value) {
             $value = intval($dataList['opinion'][$value]);
         }
         $dataList['faq_opinion'] = $faqOpinion;
     }
     $this->_returnAjaxJson(array('status' => 1, 'msg' => null, 'data' => $dataList));
 }
Example #17
0
 /**
  * 卡号充值
  */
 public function actionCardPay()
 {
     if ($this->_isPost()) {
         //post请求,充值
         $this->_modelGoldCard = $this->_getGlobalData('Model_GoldCardHD', 'object');
         $data = $this->_modelGoldCard->pay($_POST, self::GAME_ID);
         $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href'], null);
         //直接发卡测试
         //			$getArr=array(
         //				'm'=>'User',
         //				'c'=>'Deposit',
         //				'a'=>'Pay',
         //				'addcoin'=>1,	//套餐
         //				'Uname'=>$_POST['use_name'],
         //				'Money'=>$_POST['Money'],
         //				'Transactionid'=>$_POST['Transactionid'],
         //				'Depay'=>0,
         //				'gDepay'=>0,
         //				'isGoldCard'=>1,
         //				'GoldCard'=>md5(CURRENT_TIME),
         //				'GameId'=>1,
         //				'ServiceId'=>'B2',
         //	//			'syskey'=>$this->_payKey[$cardDetail['operator_id']]['key'],
         //			);
         //			$syskey='!@$$DSDGldj*73@sls-(3';
         //			$sign="Depay={$getArr['Depay']}&gDepay={$getArr['gDepay']}&addcoin={$getArr['addcoin']}&Uname={$getArr['Uname']}&Money={$getArr['Money']}&GameId={$getArr['GameId']}&ServiceId={$getArr['ServiceId']}&Transactionid={$getArr['Transactionid']}&Key={$syskey}";
         //			$getArr['Sign']=md5($sign);
         //			$serverList = $this->_getGlobalData('server/server_list_'.self::GAME_ID);
         //			$url=$serverList[$_POST['server_id']]['server_url'].'php/interface.php';
         //			$this->_utilApiFrg=$this->_getGlobalData('Util_ApiFrg','object');
         //			$this->_utilApiFrg->addHttp($url,$getArr);
         //			$this->_utilApiFrg->send();
         //			$data=$this->_utilApiFrg->getResult();
         //			if ($data['data']==1){//成功
         //				$this->_utilMsg->showMsg('领取成功',1);
         //			}else {
         //				$this->_utilMsg->showMsg('领取失败<br>'.$data['message'],1);
         //			}
     } elseif ($this->_isAjax()) {
         //ajax请求返回用户名
         $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object');
         $serverId = Tools::coerceInt($_GET['server_id']);
         $getArr = array('c' => 'UserData', 'a' => 'UserQuery', 'Page' => 1);
         $postArr = array('PageSize' => 10, 'Query[start]' => $_GET['user_name'], 'Query[Items]' => '8');
         $this->_utilApiFrg->addHttp($serverId, $getArr, $postArr);
         $this->_utilApiFrg->send();
         $data = $this->_utilApiFrg->getResult();
         if (count($data['data']['list'])) {
             $user = reset($data['data']['list']);
             $this->_returnAjaxJson(array('status' => 1, 'data' => $user['VUserName']));
         } else {
             $this->_returnAjaxJson(array('status' => 0, 'data' => null));
         }
     } else {
         //显示页面
         $this->_checkOperatorAct();
         $serverList = $this->_getGlobalData('server/server_list_' . self::GAME_ID);
         foreach ($serverList as &$list) {
             unset($list['room_id'], $list['game_type_id'], $list['marking'], $list['time_zone'], $list['timezone'], $list['server_url'], $list['timer'], $list['ext']);
         }
         $this->_view->assign('serverList', json_encode($serverList));
         $this->_view->display();
     }
 }
Example #18
0
 /**
  * 添加服务器
  */
 private function _add()
 {
     if ($this->_isPost()) {
         if ($_POST['batch_add']) {
             $start = Tools::coerceInt($_POST['start']);
             $end = Tools::coerceInt($_POST['end']);
             $addArrs = array();
             for ($i = $start; $i <= $end; $i++) {
                 $addArrs[$i] = array('game_type_id' => intval($_POST['game_type']), 'operator_id' => intval($_POST['operator_id']), 'ordinal' => $i, 'server_name' => str_replace('{$var}', $i, $_POST['server_name']), 'marking' => str_replace('{$var}', $i, $_POST['marking']), 'server_url' => str_replace('{$var}', $i, $_POST['server_url']), 'timezone' => trim($_POST['timezone']), 'time_zone' => trim($_POST['time_zone']), 'timer' => intval($_POST['timer']), 'data_url' => str_replace('{$var}', $i, $_POST['data_url']));
             }
             $reuslt = $this->_modelGameSerList->adds($addArrs);
         } else {
             $addArr = array('game_type_id' => intval($_POST['game_type']), 'operator_id' => intval($_POST['operator_id']), 'ordinal' => intval($_POST['ordinal']), 'server_name' => trim($_POST['server_name']), 'marking' => trim($_POST['marking']), 'server_url' => trim($_POST['server_url']), 'timezone' => trim($_POST['timezone']), 'time_zone' => trim($_POST['time_zone']), 'timer' => intval($_POST['timer']), 'data_url' => trim($_POST['data_url']));
             $reuslt = $this->_modelGameSerList->add($addArr);
         }
         if ($reuslt) {
             $this->_utilMsg->showMsg(Tools::getLang('ADD_SUCCESS', 'Common'), 1, Tools::url(CONTROL, ACTION));
         } else {
             $this->_utilMsg->showMsg(Tools::getLang('ADD_ERROR', 'Common'), -2);
         }
     } else {
         $gameTypeList = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name');
         $operatorList = $this->_modelOperatorList->findAll();
         $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name');
         $this->_view->assign('operatorList', $operatorList);
         $this->_view->assign('gameTypeList', $gameTypeList);
         $timer = array('0' => '关闭', '1' => '开启');
         $this->_view->assign('timer', $timer);
         $this->_utilMsg->createNavBar();
         $this->_view->set_tpl(array('body' => 'GameSerList/Add.html'));
         $this->_view->display();
     }
 }
 /**
  * 删除工单
  */
 public function actionDel()
 {
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $workOrderId = $_REQUEST['id'];
     if (is_array($workOrderId)) {
         //判断单个删除或是多个删除
         $workOrderId = implode(',', $workOrderId);
         $isOk = $this->_modelWorkOrder->update(array('status' => 4), "Id in ({$workOrderId})");
     } else {
         $workOrderId = Tools::coerceInt($workOrderId);
         $isOk = $this->_modelWorkOrder->update(array('status' => 4), "Id={$workOrderId}");
     }
     if ($isOk) {
         //是否删除成功
         $this->_returnAjaxJson(array('status' => 1, 'info' => null, 'data' => null));
     } else {
         $this->_returnAjaxJson(array('status' => 0, 'info' => null, 'data' => null));
     }
 }
Example #20
0
 /**
  * 卡号充值
  */
 public function actionCardPay()
 {
     if ($this->_isPost()) {
         //post请求,充值
         $this->_modelGoldCard = $this->_getGlobalData('Model_GoldCard', 'object');
         $data = $this->_modelGoldCard->pay($_POST, $this->game_id);
         $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href'], null);
     } elseif ($this->_isAjax()) {
         //ajax请求返回用户名
         $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object');
         $serverId = Tools::coerceInt($_GET['server_id']);
         $getArr = array('c' => 'UserData', 'a' => 'UserQuery', 'Page' => 1);
         $postArr = array('PageSize' => 10, 'Query[start]' => $_GET['user_name'], 'Query[Items]' => '8');
         $this->_utilApiFrg->addHttp($serverId, $getArr, $postArr);
         $this->_utilApiFrg->send();
         $data = $this->_utilApiFrg->getResult();
         if (count($data['data']['list'])) {
             $user = reset($data['data']['list']);
             $this->_returnAjaxJson(array('status' => 1, 'data' => $user['VUserName']));
         } else {
             $this->_returnAjaxJson(array('status' => 0, 'data' => null));
         }
     } else {
         //显示页面
         $this->_checkOperatorAct();
         $serverList = $this->_getGlobalData('server/server_list_2');
         foreach ($serverList as &$list) {
             unset($list['room_id'], $list['game_type_id'], $list['marking'], $list['time_zone'], $list['server_url']);
         }
         $this->_view->assign('serverList', json_encode($serverList));
         $this->_view->display();
     }
 }
Example #21
0
 /**
  * 审核任务
  */
 public function auditTask($postArr)
 {
     if (empty($postArr['Id'])) {
         return array('status' => -1, 'msg' => '参数错误', 'href' => 1);
     }
     $bugScorce = Tools::coerceInt($postArr['bug_scorce']);
     $task = $this->findById($postArr['Id']);
     $updateArr = array();
     $updateArr['bug_scorce'] = $bugScorce;
     if ($task['actual_hour'] != '') {
         $updateArr['efficiency_scorce'] = $this->_getEfficiency($task['precast_hour'], $task['actual_hour'], $bugScorce, $task['difficulty']);
         $updateArr['efficiency_level'] = $this->_getEfficiencyLevel($updateArr['efficiency_scorce']);
     }
     $this->update($updateArr, "Id='{$postArr['Id']}'");
     return array('status' => 1, 'msg' => '任务已审核', 'href' => Tools::url('ProgramTask', 'Index', array('zp' => 'Program')));
 }
Example #22
0
 /**
  * searchFAQ
  */
 public function actionSearch()
 {
     $this->_utilFaqSearch = $this->_getGlobalData('Util_FaqSearch', 'object');
     $keyWords = urldecode($_REQUEST['keywords']);
     if (empty($keyWords)) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'KeyWords Empty', 'data' => null));
     }
     $gameTypeId = Tools::coerceInt($_REQUEST['game_id']);
     $page = Tools::coerceInt($_REQUEST['p']);
     if (!$page) {
         $page = 1;
     }
     $pageSize = Tools::coerceInt($_REQUEST['ps']);
     if (!$pageSize) {
         $pageSize = 8;
     }
     $this->_utilFaqSearch->setFaqStatus(1);
     //设置不需要官网的
     $this->_utilFaqSearch->setLimit($page, $pageSize);
     $data = $this->_utilFaqSearch->search($keyWords, $gameTypeId, $this->_curLang);
     if (!is_array($data)) {
         $this->_returnAjaxJson(array('status' => 0, 'info' => 'NO_FIND', 'data' => null));
     }
     $dataList = array();
     if (is_array($data['data'])) {
         foreach ($data['data'] as $key => &$list) {
             if (is_array($list)) {
                 unset($data['data'][$key]['answer_g'], $data['data'][$key]['answer_s']);
             }
         }
         $dataList = $data['data'];
     }
     $toalPgae = ceil($data['info']['total'] / $pageSize);
     $this->_returnAjaxJson(array('status' => 1, 'info' => 'InterfaceFaq_Search', 'data' => array('page' => array('total' => $data['info']['total'], 'total_page' => $toalPgae, 'page' => $page, 'page_size' => $pageSize), 'list' => $dataList)));
 }
Example #23
0
 public function addServerlist($data)
 {
     if ($data['batch_add']) {
         $start = Tools::coerceInt($data['start']);
         $end = Tools::coerceInt($data['end']);
         $addArrs = array();
         for ($i = $start; $i <= $end; $i++) {
             $addArrs[$i] = array('game_type_id' => intval($data['game_type']), 'operator_id' => intval($data['operator_id']), 'ordinal' => $i, 'server_name' => str_replace('{$var}', $i, $data['server_name']), 'marking' => str_replace('{$var}', $i, $data['marking']), 'server_url' => str_replace('{$var}', $i, $data['server_url']), 'timezone' => trim($data['timezone']), 'time_zone' => trim($data['time_zone']), 'timer' => intval($data['timer']), 'data_url' => str_replace('{$var}', $i, $data['data_url']), 'isCenter' => intval($data['isCenter']));
         }
         $reuslt = $this->adds($addArrs);
     } else {
         $addArr = array('game_type_id' => intval($data['game_type']), 'operator_id' => intval($data['operator_id']), 'ordinal' => intval($data['ordinal']), 'server_name' => trim($data['server_name']), 'marking' => trim($data['marking']), 'server_url' => trim($data['server_url']), 'timezone' => trim($data['timezone']), 'time_zone' => trim($data['time_zone']), 'timer' => intval($data['timer']), 'data_url' => trim($data['data_url']), 'isCenter' => intval($data['isCenter']));
         $reuslt = $this->add($addArr);
     }
     if ($reuslt) {
         return true;
     } else {
         return false;
     }
 }
Example #24
0
 /**
  * 重置工作量
  */
 private function _rest()
 {
     $roomId = Tools::coerceInt($_GET['Id']);
     //需要重置工作量的房间ID
     $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object');
     $data = $this->_modelWorkOrder->clearRoomOrder($roomId);
     $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href']);
 }