Example #1
0
 public function getPostData($post = null)
 {
     $this->_serverId = intval($_REQUEST['server_id']);
     $this->_players = $this->_getPlayers();
     $this->_playerType = intval($_POST['playerType']);
     $this->_endTime = trim($_POST['endTime']);
     $this->_cause = trim($_POST['cause']);
     $validate = array('users' => array('trim', '玩家不能为空'), 'playerType' => array(array('in_array', '###', array(1, 2, 3)), '玩家类型错误'));
     $postData = array('users' => $this->_players, 'playerType' => $this->_playerType);
     $check = Tools::arrValidate($postData, $validate);
     if ($check !== true) {
         $this->jump($check, -1);
     }
     return $postData;
 }
Example #2
0
 public function getPostData($post = null)
 {
     $postData = array();
     $postData['orderId'] = trim($_GET['orderId']);
     $postData['type'] = intval($_GET['type']);
     $postData['value'] = urlencode(trim($_GET['value']));
     $postData['pageIndex'] = max(1, intval($_GET['page']));
     $postData['pageSize'] = PAGE_SIZE;
     $validate = array('type' => array(array('array_key_exists', '###', $this->_chargeType), '玩家类型错误'));
     $check = Tools::arrValidate($postData, $validate);
     if ($check !== true) {
         $this->jump($check, -1);
     }
     return $postData;
 }
Example #3
0
 public function getPostData($post = null)
 {
     $_serverId = intval($_REQUEST['server_id']);
     $remark = $_POST['remark'];
     $account = $_POST['account'];
     $startTime = strtotime($_POST['startTime']);
     $endTime = strtotime($_POST['endTime']);
     $validate = array('account' => array('trim', '玩家不能为空'), 'startTime' => array('is_numeric', '开始时间格式错误'), 'endTime' => array('is_numeric', '结束时间格式错误'), 'remark' => array());
     $postData = array('account' => $account, 'startTime' => $startTime, 'endTime' => $endTime, 'remark' => $remark);
     $check = Tools::arrValidate($postData, $validate);
     if ($check !== true) {
         $this->jump($check, -1);
     }
     return $postData;
 }
Example #4
0
 public function getPostData($post = null)
 {
     $plarerType = array(1 => 'nickNameList', 2 => 'openIdList');
     $this->_serverId = intval($_REQUEST['server_id']);
     $this->_players = $this->_getPlayers();
     $this->_playerType = intval($_POST['playerType']);
     $this->_endTime = trim($_POST['endTime']);
     $this->reason = trim($_POST['cause']);
     $validate = array($plarerType[$this->_playerType] => array('trim', '玩家不能为空'), 'endTime' => array('time', '时间格式错误'), 'reason' => array('trim', '原因不能为空'));
     $postData = array($plarerType[$this->_playerType] => $this->_players, 'endTime' => strtotime($this->_endTime), 'reason' => $this->reason);
     $check = Tools::arrValidate($postData, $validate);
     if ($check !== true) {
         $this->jump($check, -1);
     }
     return $postData;
 }
 public function getPostData($post = null)
 {
     $this->_serverId = intval($_REQUEST['server_id']);
     $this->_players = $this->_getPlayers();
     $this->_playerType = intval($_POST['userType']);
     $this->_endTime = trim($_POST['endTime']);
     $this->_cause = trim($_POST['cause']);
     $this->_lockUserType = intval(trim($_POST['lockUserType']));
     $validate = array('user' => array('trim', '玩家不能为空'), 'userType' => array(array('in_array', '###', array(0, 1, 2)), '玩家类型错误'));
     $postData = array('user' => $this->_players, 'userType' => $this->_playerType, 'endTime' => strtotime($this->_endTime), 'type' => $this->_lockUserType);
     $check = Tools::arrValidate($postData, $validate);
     if ($check !== true) {
         $this->jump($check, -1);
     }
     if ($post && is_array($post)) {
         $postData = array_merge($post, $postData);
     }
     return $postData;
 }
Example #6
0
 public function getPostData($post = null)
 {
     $type = intval($_POST['type']);
     $keyType = intval($_POST['keyType']);
     $classId = intval($_POST['classId']);
     $bindType = intval($_POST['bindType']);
     //bindType	Int	否	绑定类型。0:不绑定,1:绑定服,2:绑定玩家
     $counts = $bindType === 2 ? 1 : max(1, intval($_POST['counts']));
     //counts	Int	否	礼包卡密的数量
     $playerId = $bindType === 2 ? trim($_POST['playerId']) : 0;
     //playerId	Long	是	绑定玩家是玩家Id
     $mailTitle = trim($_POST['mailTitle']);
     //mailTitle	String	是	邮件标题
     $mailContent = trim($_POST['mailContent']);
     //mailContent	String	是	邮件内容
     $postData = compact('type', 'keyType', 'classId', 'bindType', 'counts', 'playerId', 'mailTitle', 'mailContent');
     //		if($bindType == 1){
     //			$postData['serverId'] = $this->_gameObject->getServerId();//在getData中已经带上
     //		}
     $postData['__fields__'] = array('batchId' => 'Id');
     //batchId将要换成申请的id,作为批号
     //对$postData进行数据调整
     $this->_isSendMail($postData);
     if ($_POST['importFile'] == 1) {
         //上传文件知runtime目录的某个目录中
         $postData['filePath'] = $this->_FileUpload();
         //
         if (!$postData['filePath']) {
             $this->jump("上传文件失败", -1);
         }
         $postData['importFile'] = 1;
     }
     $validate = array('type' => array(array('array_key_exists', '###', $this->_assign[self::ITEM_PACKAGE_TYPE]), '礼包类型不合法'), 'keyType' => array(array('array_key_exists', '###', $this->_assign[self::KEY_TYPE]), '卡类型不合法'), 'classId' => array(array('max', 0, '###'), '礼包ID错误'), 'bindType' => array(array('array_key_exists', '###', $this->_assign[self::BIND_TYPE]), '绑定类型不合法'), 'playerId' => $postData['bindType'] == 2 ? $validate['playerId'] = array('trim', '绑定的玩家不能为空') : null);
     $check = Tools::arrValidate($postData, $validate);
     if ($check !== true) {
         $this->jump($check, -1);
     }
     return $postData;
 }
Example #7
0
 public function getPostData($post = null)
 {
     $type = intval($_POST['type']);
     //100:标准礼包,200: 共享礼包
     $repeat = $_POST['repeat'] ? 1 : 0;
     $keyType = intval($_POST['keyType']);
     //type	Int	否	礼包类型	1 36位 ,2 10位
     $name = strval($_POST['name']);
     //name	String	否	礼包的名字
     $bindType = intval($_POST['bindType']);
     //bindType	Int	否	绑定类型。0:不绑定,1:绑定服,2:绑定玩家
     $counts = $bindType === 2 ? 1 : max(1, intval($_POST['counts']));
     //counts	Int	否	礼包卡密的数量
     $playerType = intval($_POST['playerType']);
     //玩家类型
     $playerId = $bindType === 2 ? trim($_POST['playerId']) : 0;
     //playerId	Long	是	绑定玩家是玩家Id
     //$goldType = intval($_POST['goldType']);//goldType	Int	是	元宝类型, 1:系统元宝,2:GM元宝
     $exchangeType = intval($_POST['exchangeType']);
     $goldValue = max(0, intval($_POST['goldValue']));
     //goldValue	Int	是	元宝数量
     $goldTickeValue = max(0, intval($_POST['goldTickeValue']));
     //天心
     $prestige = max(0, intval($_POST['Prestige']));
     //声望
     $CashGift = max(0, intval($_POST['CashGift']));
     //礼金
     $Energy = max(0, intval($_POST['Energy']));
     //行动值
     $assetValue = max(0, intval($_POST['assetValue']));
     //int 银两
     $mailTitle = trim($_POST['mailTitle']);
     //mailTitle	String	是	邮件标题
     $mailContent = trim($_POST['mailContent']);
     //mailContent	String	是	邮件内容
     $expiration = strtotime(trim($_POST['expiration'])) ? trim($_POST['expiration']) : '';
     //expiration	String	是	礼包过期时间,没限制可不填或者为""
     $goods = $this->_getItemsData('ItemsData');
     //goods	String	是	道具JSON格式[{goodsId:xx, num:xx, bind:1},{},{},{}]
     $conditions = $this->_getReceiveConditions('data');
     $desn = $cause = trim($_POST['cause']);
     // 申请理由
     $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object');
     $userClass = $this->_utilRbac->getUserClass();
     if ($userClass['_departmentId'] == 1 && in_array('kf_xz', $userClass['_roles'])) {
         if ($goldValue > 20000) {
             $this->jump('元宝不能超过20000', -1);
         }
     }
     $points = json_encode(array('goldValue' => $goldValue, 'assetValue' => $assetValue, 'goldTickeValue' => $goldTickeValue, 'Prestige' => $prestige, 'CashGift' => $CashGift, 'Energy' => $Energy));
     $postData = compact('type', 'repeat', 'keyType', 'name', 'counts', 'bindType', 'playerType', 'playerId', 'points', 'exchangeType', 'goldTickeValue', 'mailTitle', 'mailContent', 'expiration', 'goods', 'conditions', 'desn', 'goldValue', 'assetValue', 'goldTickeValue', 'prestige', 'CashGift', 'Energy');
     //		if($bindType == 1){
     //			$postData['serverId'] = $this->_gameObject->getServerId();//在getData中已经带上
     //		}
     $postData['__fields__'] = array('batchId' => 'Id');
     //batchId将要换成申请的id,作为批号
     //对$postData进行数据调整
     $this->_isSendMail($postData);
     $this->_goldExist($postData);
     $validate = array('type' => array(array('array_key_exists', '###', $this->_assign[self::ITEM_PACKAGE_TYPE]), '礼包类型不合法'), 'keyType' => array(array('array_key_exists', '###', $this->_assign[self::KEY_TYPE]), '卡密长度类型不合法'), 'name' => array('trim', '名字不能为空'), 'bindType' => array(array('array_key_exists', '###', $this->_assign[self::BIND_TYPE]), '绑定类型不合法'), 'exchangeType' => $postData['goldValue'] ? array(array('array_key_exists', '###', $this->_assign[self::EXCHANGE_TYPE]), '元宝类型超出范围') : null, 'playerId' => $postData['bindType'] == 2 ? $validate['playerId'] = array('trim', '绑定的玩家不能为空') : null);
     // 		var_dump( $postData['expiration']);
     $check = Tools::arrValidate($postData, $validate);
     if ($check !== true) {
         $this->jump($check, -1);
     }
     return $postData;
 }
Example #8
0
 public function getPostData($post = null)
 {
     $id = intval($_REQUEST['classId']);
     $type = intval($_POST['type']);
     //100:标准礼包,200: 共享礼包
     $repeat = $_POST['repeat'] ? 1 : 0;
     $keyType = intval($_POST['keyType']);
     //type	Int	否	礼包类型	1 36位 ,2 10位
     $name = strval($_POST['name']);
     //name	String	否	礼包的名字
     $bindType = intval($_POST['bindType']);
     //bindType	Int	否	绑定类型。0:不绑定,1:绑定服,2:绑定玩家
     $counts = $bindType === 2 ? 1 : max(1, intval($_POST['counts']));
     //counts	Int	否	礼包卡密的数量
     $playerId = $bindType === 2 ? trim($_POST['playerId']) : 0;
     //playerId	Long	是	绑定玩家是玩家Id
     //$goldType = intval($_POST['goldType']);//goldType	Int	是	元宝类型, 1:系统元宝,2:GM元宝
     $exchangeType = intval($_POST['exchangeType']);
     $goldValue = max(0, intval($_POST['goldValue']));
     //goldValue	Int	是	元宝数量
     $goldTickeValue = max(0, intval($_POST['goldTickeValue']));
     $assetValue = max(0, intval($_POST['assetValue']));
     //int 银两
     $mailTitle = trim($_POST['mailTitle']);
     //mailTitle	String	是	邮件标题
     $mailContent = trim($_POST['mailContent']);
     //mailContent	String	是	邮件内容
     $expiration = $this->_expire($_POST['expiration']);
     // strtotime(trim($_POST['expiration']))?trim($_POST['expiration']):'';//expiration	String	是	礼包过期时间,没限制可不填或者为""
     $goods = $this->_getItemsData('ItemsData');
     //goods	String	是	道具JSON格式[{goodsId:xx, num:xx, bind:1},{},{},{}]
     $conditions = $this->_getReceiveConditions('data');
     $postData = compact('id', 'type', 'repeat', 'keyType', 'name', 'counts', 'bindType', 'playerId', 'goldValue', 'exchangeType', 'goldTickeValue', 'assetValue', 'mailTitle', 'mailContent', 'expiration', 'goods', 'conditions');
     //		if($bindType == 1){
     //			$postData['serverId'] = $this->_gameObject->getServerId();//在getData中已经带上
     //		}
     $postData['batchId'] = 1;
     //batchId将要换成申请的id,作为批号
     //对$postData进行数据调整
     $this->_isSendMail($postData);
     $this->_goldExist($postData);
     $validate = array('type' => array(array('array_key_exists', '###', $this->_assign[self::ITEM_PACKAGE_TYPE]), '礼包类型不合法'), 'keyType' => array(array('array_key_exists', '###', $this->_assign[self::KEY_TYPE]), '卡密长度类型不合法'), 'name' => array('trim', '名字不能为空'), 'bindType' => array(array('array_key_exists', '###', $this->_assign[self::BIND_TYPE]), '绑定类型不合法'), 'exchangeType' => $postData['goldValue'] ? array(array('array_key_exists', '###', $this->_assign[self::EXCHANGE_TYPE]), '元宝类型超出范围') : null, 'playerId' => $postData['bindType'] == 2 ? $validate['playerId'] = array('trim', '绑定的玩家不能为空') : null, 'expiration' => $postData['expiration'] !== 0 ? array(array('max', '###', 0), '如果填写过期时间,则需大于当前时间') : null);
     $check = Tools::arrValidate($postData, $validate);
     if ($check !== true) {
         $this->jump($check, -1);
     }
     return $postData;
 }