diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index 4eb1015a..46d18637 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -953,6 +953,8 @@ class ServiceController extends Zend_Controller_Action foreach ($matchs[1] as $k=>$v){ if($k < $max) $rev[$k]['url']=$v; } + }else{ + $error = "无搜索结果"; } if(preg_match_all("#(.+?)#i",$body,$matchs,PREG_PATTERN_ORDER)) @@ -962,7 +964,7 @@ class ServiceController extends Zend_Controller_Action } } - $response=array("result"=>$rev,"count"=>$max,"morelink"=>'http://search.cnki.net/search.aspx?q='.$keyword); + $response=array("result"=>$rev,"count"=>$max,"morelink"=>'http://search.cnki.net/search.aspx?q='.$keyword,"error"=>$error); $rev = Zend_Json::encode($response); return $rev; diff --git a/application/default/views/scripts/heihe/view.phtml b/application/default/views/scripts/heihe/view.phtml index 55f20468..3a905e22 100755 --- a/application/default/views/scripts/heihe/view.phtml +++ b/application/default/views/scripts/heihe/view.phtml @@ -91,7 +91,7 @@ else timebegin)) : ?>
最近10条服务记录如下:
' - +val['url'].replace(/%(.*)/i,"") +'
' - +val['content'] - +'
'; - - items.push('' + +val['url'].replace(/%(.*)/i,"") +'
' + +val['content'] + +'
'; + + items.push('