/** * 请求数据检测 * * @return mixed */ public function _checkData($sType = 'add') { $sPermissionName = $this->getParam('sPermissionName'); $sPath = $this->getParam('sPath'); $iMenuID = $this->getParam('iMenuID'); if (!Util_Validate::isLength($sPermissionName, 2, 30)) { return $this->showMsg('权限名长度范围为2到30个字!', false); } if (!Util_Validate::isLength($sPath, 2, 50)) { return $this->showMsg('权限点长度范围为2到30个字符!', false); } if (empty($iMenuID)) { return $this->showMsg('请选择权限点的归属模块!', false); } $iCnt = Model_Menu::getCnt(array('where' => array('iParentID' => $iMenuID))); if ($iCnt > 0) { return $this->showMsg('归属模块只能选择最底层的模块!', false); } $aRow = array('sPermissionName' => $sPermissionName, 'sPath' => $sPath, 'iMenuID' => $iMenuID); return $aRow; }