|
@@ -1451,6 +1451,32 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
}
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取网站栏目seo
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getWebsiteCategoryHead(array $data): array
|
|
|
+ {
|
|
|
+ if(isset($data['website_id']) && !empty($data['website_id'])){
|
|
|
+ $website = Website::where('id',$data['website_id'])->where('status',1)->first();
|
|
|
+ if (empty($website)) {
|
|
|
+ return Result::error("找不到网站",0);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return Result::error("参数错误",0);
|
|
|
+ }
|
|
|
+ if (isset($data['catid']) && !empty($data['catid'])) {
|
|
|
+ $fcatid = WebsiteCategory::where('website_id',$data['website_id'])->where('category_id',$data['catid'])->first();
|
|
|
+ if (empty($fcatid)) {
|
|
|
+ return Result::error("导航id错误",0);
|
|
|
+ }
|
|
|
+ $result = Category::where('id',$data['catid'])->first();
|
|
|
+ }
|
|
|
+ if (empty($result)) {
|
|
|
+ return Result::error("暂无导航",0);
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
|
|
|
}
|