public function getfaAction() { $result = $this->getRequest()->getParams(); $nid = $result['nid']; $data = array(); if ($nid) { $fa = new Product_Model_Fadev(); $where = "t1.nid={$nid} and (t1.type = 'DEV' or t1.type = 'ECO')"; $data = $fa->getList($where); for ($i = 0; $i < count($data); $i++) { if (($typeId = $data[$i]['type']) != '') { $typeName = $this->getTypeByConnect($typeId, ''); $data[$i]['type_name'] = $typeName; } $data[$i]['bom_file_view'] = $data[$i]['bom_file']; } } // 转为json格式并输出 echo Zend_Json::encode($data); exit; }