Prechádzať zdrojové kódy

Merge branch 'web_sannong_fr'

15313670163 5 dní pred
rodič
commit
53d4649094
1 zmenil súbory, kde vykonal 5 pridanie a 5 odobranie
  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 {