|
@@ -320,12 +320,6 @@ class NewsService implements NewsServiceInterface
|
|
if(empty($result)){
|
|
if(empty($result)){
|
|
return Result::error("查询失败",0);
|
|
return Result::error("查询失败",0);
|
|
}
|
|
}
|
|
- $category = WebsiteCategory::where('website_id',$data['website_id'])->where(['category_id'=>$result['catid']])->first();
|
|
|
|
- if(empty($category)){
|
|
|
|
- return Result::error("查询失败",0);
|
|
|
|
- }
|
|
|
|
- $result['category_id'] = $category['category_id'];
|
|
|
|
- $result['cat_name'] = $category['name'];
|
|
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
@@ -481,6 +475,29 @@ class NewsService implements NewsServiceInterface
|
|
}
|
|
}
|
|
return Result::success($data);
|
|
return Result::success($data);
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 前端-获取新闻详情
|
|
|
|
+ * @param array $data
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function selectWebsiteArticleInfo(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $where = [
|
|
|
|
+ 'article.id'=>$data['id'],
|
|
|
|
+ 'article.status'=>1
|
|
|
|
+ ];
|
|
|
|
+ $result = Article::where($where)->leftJoin("article_data","article.id","article_data.article_id")->first();
|
|
|
|
+ if(empty($result)){
|
|
|
|
+ return Result::error("查询失败",0);
|
|
|
|
+ }
|
|
|
|
+ $category = WebsiteCategory::where('website_id',$data['website_id'])->where(['category_id'=>$result['catid']])->first();
|
|
|
|
+ if(empty($category)){
|
|
|
|
+ return Result::error("查询失败",0);
|
|
|
|
+ }
|
|
|
|
+ $result['category_id'] = $category['category_id'];
|
|
|
|
+ $result['cat_name'] = $category['name'];
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|