|
@@ -725,9 +725,9 @@ class NewsService implements NewsServiceInterface
|
|
|
$article->pinyin = $pinyin;
|
|
|
return $article;
|
|
|
});
|
|
|
- if (empty($result)) {
|
|
|
- return Result::success([]);
|
|
|
- }
|
|
|
+ if (empty($result)) {
|
|
|
+ return Result::success();
|
|
|
+ }
|
|
|
return Result::success($result);
|
|
|
} else {
|
|
|
return Result::error("参数错误level=7,id不能为空", 0);
|
|
@@ -778,8 +778,8 @@ class NewsService implements NewsServiceInterface
|
|
|
$article->pinyin = $pinyin;
|
|
|
return $article;
|
|
|
});
|
|
|
- if (empty($result)) {
|
|
|
- return Result::error("暂无头条新闻", 0);
|
|
|
+ if (empty($result) || count($result) == 0) {
|
|
|
+ return Result::error("暂无头条新闻");
|
|
|
}
|
|
|
return Result::success($result);
|
|
|
} else {
|