public function getColdchainCapacityAction() { $province = $this->_request->getParam('province', ''); $district = $this->_request->getParam('district', ''); $type = $this->_request->getParam('type', ''); $level = $this->_request->getParam('level', ''); $level = empty($level) ? 1 : $level; $geoModel = new Model_Geo(); if ($level == 1) { $return = $geoModel->getColdChainProvince($type); } else { if ($level == 4) { $return = $geoModel->getColdChainDistrict($province, $type); } else { $return = $geoModel->getColdchainTehsil($province, $district, $type); } } echo Zend_Json::encode($return); }