public function searchBatchByNumberAction() { $wh_id = $this->_request->getParam('wh_id', ''); $batch_no = $this->_request->getParam('batch_no', ''); if (!empty($wh_id) || !empty($batch_no)) { $coldchain = new Model_ColdChain(); $result = $coldchain->searchBatchByBatchNo($wh_id, $batch_no); } else { $result = array("error" => "Please provide these params. e.g. (?wh_id=1&batch_no=I1010)"); } echo Zend_Json::encode($result); }