/** * 根据id来接收一个请求 * @param int $id * @return boolean/string */ private function _acceptId($id) { $data = $this->findById($id); if (!in_array($data['type'], $this->_options)) { return "Id:{$id} : <font color='#FF0000'>您没有权限审核这项</font>."; } if ($this->_operatorsLimit && !in_array($data['operator_id'], $this->_operatorsLimit)) { return "Id:{$id} : <font color='#FF0000'>您没有权限审核这项</font>."; } if ($data) { $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object'); $userClass = $this->_utilRbac->getUserClass(); if ($data['is_send'] == 1) { return "Id:{$id} 已经被审核过"; } if ($data['type'] >= 10) { //如果是批量审核的话 switch ($data['type']) { case '10': //多服务器发送奖励 $serverList = $this->_getGlobalData('gameser_list'); $data['post_data'] = unserialize($data['post_data']); $data['post_data']['send_players'] = str_replace('\\', '', $data['post_data']['send_players']); //去除\,好反序列化 $sendPlayerIds = unserialize($data['post_data']['send_players']); //得到要发送的玩家 unset($data['post_data']['send_players']); //删除掉这些玩家,一会好发送post数据给游戏接口 $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object'); $this->_utilApiFrg->curlInit(); $getArr = unserialize($data['send_action']); foreach ($sendPlayerIds as $key => $list) { $data['post_data']['UserIds'] = implode(',', $list); //加自要发送的玩家ID $data['post_data']['UserIds'] = str_replace(' ', '', $data['post_data']['UserIds']); //去掉空格 $this->_utilApiFrg->addHttp($key, $getArr, $data['post_data']); } $this->_utilApiFrg->send(); $sendResult = array(); $result = $this->_utilApiFrg->getResults(); foreach ($result as $key => $backParams) { $color = $backParams['msgno'] == 1 ? '#00CC00' : '#ff0000'; //定义颜色 $message = $backParams['msgno'] == 1 ? '发送成功' : '发送失败'; $backParams['message'] = $backParams['message'] ? $backParams['message'] : $message; if ($backParams) { $string = "{$serverList[$key]['full_name']} : <font color='{$color}'>{$backParams['message']}</font>"; $string = $this->_createAcceptMsg(1, $backParams, $string); //发送消息 array_push($sendResult, $string); } else { $string = "{$serverList[$key]['full_name']} : <font color='{$color}'>{$backParams['message']}</font>"; array_push($sendResult, $string); } } $retStr = implode('<br>', $sendResult); $this->update(array('is_send' => 1, 'audit_ip' => ip2long(Tools::getClientIP()), 'send_time' => CURRENT_TIME, 'audit_user_id' => $userClass['_id'], 'send_result' => $retStr), "Id={$id}"); $this->_utilApiFrg = null; return $retStr; case '11': //多服务器奖励触发 $serverList = $this->_getGlobalData('gameser_list'); $data['post_data'] = unserialize($data['post_data']); $serverIds = $data['post_data']['server_ids']; //得到要发送的服务器 unset($data['post_data']['server_ids']); //删除掉这些玩家,一会好发送post数据给游戏接口 $this->_utilApiFrg = $this->_getGlobalData('Util_ApiFrg', 'object'); $this->_utilApiFrg->curlInit(); $getArr = unserialize($data['send_action']); foreach ($serverIds as $serverId) { $this->_utilApiFrg->addHttp($serverId, $getArr, $data['post_data']); } $this->_utilApiFrg->send(); $sendResult = array(); $result = $this->_utilApiFrg->getResults(); foreach ($result as $key => $backParams) { $color = $backParams['msgno'] == 1 ? '#00CC00' : '#ff0000'; //定义颜色 $message = $backParams['msgno'] == 1 ? '发送成功' : '发送失败'; $backParams['message'] = $backParams['message'] ? $backParams['message'] : $message; if ($backParams) { $string = "{$serverList[$key]['full_name']} : <font color='{$color}'>{$backParams['message']}</font>"; array_push($sendResult, $string); } else { $string = "{$serverList[$key]['full_name']} : <font color='{$color}'>{$backParams['message']}</font>"; array_push($sendResult, $string); } } $retStr = implode('<br>', $sendResult); $this->update(array('is_send' => 1, 'audit_ip' => ip2long(Tools::getClientIP()), 'send_time' => CURRENT_TIME, 'audit_user_id' => $userClass['_id'], 'send_result' => $retStr), "Id={$id}"); $this->_utilApiFrg = null; return $retStr; case '12': //生成金币卡 $this->_modelGoldCard = $this->_getGlobalData('Model_GoldCard', 'object'); $data = $this->_modelGoldCard->import(unserialize($data['post_data'])); if ($data['status'] == 1) { $updateArr = array('is_send' => 1, 'audit_ip' => ip2long(Tools::getClientIP()), 'send_time' => CURRENT_TIME, 'audit_user_id' => $userClass['_id'], 'send_result' => "Id:{$id} <font color='#00CC00'>生成金币卡成功</font>"); $this->update($updateArr, "Id={$id}"); return '<font color="#00CC00">' . $data['msg'] . '</font>'; } return '<font color="#FF0000">生成金币卡失败</font>'; } } else { $this->_utilFRGInterface = $this->_getGlobalData('Util_FRGInterface', 'object'); $this->_utilFRGInterface->setServerUrl($data['server_id']); $this->_utilFRGInterface->setGet(unserialize($data['send_action'])); $this->_utilFRGInterface->setPost(unserialize($data['post_data'])); $backParams = $this->_utilFRGInterface->callInterface(); $this->_utilFRGInterface = null; $color = $backParams['msgno'] == 1 ? '#00CC00' : '#ff0000'; //定义颜色 if ($backParams['msgno'] == 1) { $updateArr = array('is_send' => 1, 'audit_ip' => ip2long(Tools::getClientIP()), 'send_time' => CURRENT_TIME, 'audit_user_id' => $userClass['_id'], 'send_result' => $this->_createAcceptMsg($data['type'], $backParams, "Id:{$id} <font color='{$color}'>{$backParams['message']}</font>")); $this->update($updateArr, "Id={$id}"); } return $this->_createAcceptMsg($data['type'], $backParams, "Id:{$id} <font color='{$color}'>{$backParams['message']}</font>"); } } return "无此记录Id : {$id}"; }