/** * 提交密码遗失单 */ public function send() { //判断用户是否登录状态 if (!is_null($this->uwanName)) { $this->assign("jumpUrl", U("Index/index")); $this->success("恭喜!您已成功登录!"); return; } $needField = array('game_type' => '游戏产品', 'servers' => '服务器', 'account' => '帐号', 'game_name' => '游戏昵称', 'account_area' => '帐号注册地区', 'often_passsword' => '曾经使用密码', 'charge' => '是否曾经充值', 'host' => '帐号是否身份绑定', 'ip' => $this->get_client_ip()); if ($_POST['charge'] == 1) { $needField['charge_type'] = '是否曾经充值'; } if ($_POST['host'] == 1) { $needField['host_number'] = '帐号绑定的有效证件号码'; $needField['host_username'] = '******'; } else { $needField['host_number'] = '身份证号码'; $needField['host_username'] = '******'; } $checkReturn = $this->checkNullField($_POST, $needField); if ($checkReturn !== true) { $this->error($checkReturn . '不能为空!'); } if (!$_POST['email'] && !$_POST['telphone']) { $this->error('电子邮箱和电话至少填写一个!'); } $sendArr = $this->_getUserResult($_POST['account'], $_POST['servers'], $_POST['game_type']); if ($sendArr['user_nickname'] == '') { $this->error("所选服务器还没有建立角色!"); } elseif ($sendArr['user_nickname'] != $_POST['game_name']) { $this->error("游戏昵称输入错误,请您重新提交正确的昵称。<br/>您还可以使用邮箱找回密码或来电咨询。"); } // if(!isset($sendArr['user_id']))$sendArr['user_id'] = 0; // if(!isset($sendArr['user_account']))$sendArr['user_account']='-无-'; $sendArr['user_account'] = '-'; //账号为空时,客服回复时,玩家是收不到的 if (!isset($sendArr['user_nickname'])) { $sendArr['user_nickname'] = '-无-'; } if (!isset($sendArr['money_total'])) { $sendArr['money_total'] = 0; } if (!isset($sendArr['money_month'])) { $sendArr['money_month'] = 0; } if (!isset($sendArr['register_date'])) { $sendArr['register_date'] = 0; } if (!isset($sendArr['ip'])) { $sendArr['ip'] = '0.0.0.0'; } $sendArr['question_type'] = 0; $sendArr['game_type'] = $_POST['game_type']; $sendArr['game_server_id'] = $_POST['servers']; $sendArr['title'] = '密码遗失单'; $sendArr['operator_id'] = C("WE_OPERATOR"); $sendArr['game_id'] = $_POST['game_type']; $sendArr['source'] = 1; $curTime = C('CURRENT_TIME'); $sendArr['_sign'] = md5(C('SEND_KEY') . $curTime); $sendArr['_verifycode'] = $curTime; $changelink = "\n\r"; $str = '--账号找回信息--'; $str .= $changelink . "账号:" . $_POST['account']; $str .= $changelink . '游戏昵称:' . $_POST['game_name']; $str .= $changelink . '帐号注册地区:' . $_POST['account_area']; $str .= $changelink . '注册初始密码:' . $_POST['start_password']; $str .= $changelink . '曾经使用密码:' . $_POST['often_passsword']; $str .= $changelink . '是否曾经充值:' . ($_POST['charge'] == 1 ? '是' : '否'); $str .= $changelink . '充值类型:'; switch ($_POST['charge_type']) { case '1': $str .= '充值卡'; break; case '2': $str .= '网上银行'; $str .= $changelink . '其中一次充值网银订单:' . $_POST['charge_order']; break; default: $str .= '其他'; } $str .= $changelink . '帐号是否身份绑定:' . ($_POST['host'] == 1 ? '是' : '否'); $str .= $changelink . '帐号绑定的有效证件号码:' . $_POST['host_number']; $str .= $changelink . '身份持有人姓名:' . $_POST['host_username']; $str .= $changelink . '电子邮箱:' . $_POST['email']; $str .= $changelink . '电话:' . $_POST['telphone']; if (!is_null($this->uwanName)) { $str .= $changelink . $changelink . "提问者:{$this->uwanName}"; } else { $str .= $changelink . $changelink . '(注:该消息回复,不会有玩家收到!)'; } $sendArr['content'] = $str; import('@.Util.WebService'); $webService = new WebService(); $webService->setUrl(C('SEND_ORDER_URL')); $webService->setGet(array('c' => 'InterfaceWorkOrder', 'a' => 'QuestionSave')); $webService->setPost($sendArr); $webService->sendData(); $backParams = $webService->getRaw(); $backParams = json_decode($backParams); if ($backParams->status == 1) { $this->assign("jumpUrl", U("Index/index")); $this->success("您的问题已受理!"); } else { $this->error('提交失败!'); } }
/** * 增加回复 */ public function addqa() { import('@.Util.WebService'); $webService = new WebService(); $webService->setUrl(C('SEND_ORDER_URL')); $webService->setGet(array('c' => 'InterfaceWorkOrder', 'a' => 'Reply')); //追问地址 $curTime = C('CURRENT_TIME'); $sendArr['id'] = intval($_POST['id']); $workOrderDao = M('work_order'); $data = $workOrderDao->find($sendArr['id']); if ($data['user_account'] != $this->uwanName) { $this->error('提问失败,参数错误'); } //防止参数注入 $sendArr['content'] = stripcslashes($_POST['content']); $sendArr['_sign'] = md5(C('SEND_KEY') . $curTime); $sendArr['_verifycode'] = $curTime; $webService->setPost($sendArr); $webService->sendData(); $backParams = $webService->getRaw(); $backParams = json_decode($backParams); if ($backParams->status == 1) { $this->assign("jumpUrl", U("Question/detail/id/{$sendArr['id']}")); $this->success("您的问题已受理,此问题的等候队列:第 " . $this->_getQueue($data['game_type'], $data['room_id']) . " 位,请耐等侍。"); } else { $this->ajaxReturn(null, '追问错误,请重试', 0); $this->error("提交失败!"); } }
/** * 返回用户在哪个服务器里面有角色的服务器列表 * @param $gameId */ private function _getCreateUserServerIds($gameId) { $game_type = $this->getSysConfig("game_type"); $UwanGameId = $game_type[$gameId]['UwanGameId']; $key = "create_user_server_{$UwanGameId}_{$this->uwanName}"; $serverList = S($key); if (!$serverList) { import('@.Util.WebService'); $webService = new WebService(); $webService->setUrl(C('USER_CREATE_SERVER_URL')); $webService->setGet(array('g' => $UwanGameId, 'u' => $this->uwanName)); $webService->sendData(); $data = $webService->getRaw(); $data = json_decode($data); $serverList = get_object_vars($data->last_list); foreach ($serverList as $k => $list) { if (strpos($list, 'N')) { unset($serverList[$k]); } } if ($serverList) { S($key, $serverList, 60 * 60 * 2); } } return $serverList; }