Ver Fonte

!2 修改getArtilclett方法
Merge pull request !2 from the_bug/news_10_21_fr

rkljw há 6 meses atrás
pai
commit
987f10527f
1 ficheiros alterados com 10 adições e 6 exclusões
  1. 10 6
      app/JsonRpc/NewsService.php

+ 10 - 6
app/JsonRpc/NewsService.php

@@ -289,11 +289,12 @@ class NewsService implements NewsServiceInterface
             return Result::error("查询失败",0);
         }
     }
-     /**
+    /**
+     *  获取新闻
      * @param array $data
      * @return array
-     */
-    public function getWebsiteArticlett(array $data): array   // 获取新闻
+    */
+    public function getWebsiteArticlett(array $data): array   
     {
     
        $category = WebsiteCategory::where('website_id',$data['website_id'])->select('category_id')->get();
@@ -314,13 +315,16 @@ class NewsService implements NewsServiceInterface
                 return Result::error("暂无头条新闻",0);
             }            
             return Result::success($result); 
+        }else{
+            return Result::error("本网站下暂无相关栏目",0);
         }
     }
-     /**
+    /**
+     * 获取模块新闻
      * @param array $data
      * @return array
-     */
-    //   获取模块新闻
+    */
+   
     public function getWebsiteModelArticles(array $data): array    
     {
         $catid=$data['catid'];