2 Commits 6559a057ca ... 53d4649094

Author SHA1 Message Date
  15313670163 53d4649094 Merge branch 'web_sannong_fr' 3 days ago
  15313670163 25454f72ef 修改无新闻下的返回 3 days ago
1 changed files with 5 additions and 5 deletions
  1. 5 5
      app/JsonRpc/NewsService.php

+ 5 - 5
app/JsonRpc/NewsService.php

@@ -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 {