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