Пример #1
0
 /**
  * 请求数据检测
  *
  * @return mixed
  */
 public function _checkData($sType = 'add')
 {
     $sCityName = $this->getParam('sCityName');
     $sCityCode = $this->getParam('sCityCode');
     $iFrontShow = $this->getParam('iFrontShow');
     $iBackendShow = $this->getParam('iBackendShow');
     if (!Util_Validate::isLength($sCityName, 2, 20)) {
         return $this->showMsg('城市名称长度范围为2到20个字!', false);
     }
     if (!Util_Validate::isLength($sCityCode, 2, 50)) {
         return $this->showMsg('城市代码长度范围为2到50个字母!', false);
     }
     if (!Util_Validate::isRange($iFrontShow, 0, 1)) {
         return $this->showMsg('城市前台是否启用输入不合法!', false);
     }
     if (!Util_Validate::isRange($iBackendShow, 0, 1)) {
         return $this->showMsg('城市后台是否启用输入不合法!', false);
     }
     $aRow = array('sCityName' => $sCityName, 'sCityCode' => $sCityCode, 'iFrontShow' => $iFrontShow, 'iBackendShow' => $iBackendShow);
     return $aRow;
 }