15313670163 1 개월 전
부모
커밋
d670f8808e
2개의 변경된 파일42개의 추가작업 그리고 0개의 파일을 삭제
  1. 37 0
      app/JsonRpc/NewsService.php
  2. 5 0
      app/JsonRpc/NewsServiceInterface.php

+ 37 - 0
app/JsonRpc/NewsService.php

@@ -380,6 +380,43 @@ class NewsService implements NewsServiceInterface
         }
         return Result::success($result);
     }
+    /**
+     * 模块新闻加强版 
+     * @param array $data
+     * @return array
+    */
+    // public function getWebsiteCatidArticle(array $data): array
+    // {
+    //     $where = [
+    //         'category.status' => 1,
+    //         'category.category_id' => $data['catid'],
+    //         'category.website_id' => $data['website_id'],
+    //         // 'article.status' => 1,
+    //     ];
+    //     $category = WebsiteCategory::where($where)
+    //     ->leftJoin('article', 'article.catid', 'category.category_id')
+    //     ->when(!empty($data['img_num']), function ($query) use ($data) {
+    //         $query->where('status',1)
+    //             ->whereNotNull('article.img_url')
+    //             ->limit($data['img_num']);
+    //     })
+    //     ->when(!empty($data['text_num']), function ($query) use ($data) {
+    //         $query->where('status',1)
+    //         ->whereNull('article.img_url')
+    //             ->limit($data['text_num']);
+    //     })
+    //     ->get();
+    //     $result = ArticleSurvey::where($where)->first();
+    //     if(!empty($result)){
+    //         return Result::error("您已点赞过", 0);
+    //     }
+    //     $result = ArticleSurvey::insertGetId($data);
+    //     if(!$result){
+    //         return Result::error("点赞失败", 0);
+    //     }
+    //     return Result::success($result);
+    // }
+
     /**
      *获取新闻列表 
      * @param array $data

+ 5 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -127,4 +127,9 @@ interface NewsServiceInterface
      * @return array
      */
     public function selectWebsiteArticle(array $data):array;
+    //  /**
+    //  * @param array $data
+    //  * @return array
+    //  */
+    // public function getWebsiteCatidArticle(array $data):array;
 }