|
@@ -1489,9 +1489,7 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
return Result::error("参数错误",0);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
// 自助建站--fr-------------------
|
|
|
|
|
|
/**
|
|
@@ -2018,4 +2016,46 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
}
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 获取父级/子级栏目
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ * */
|
|
|
+ public function getWebsiteParentCategory(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);
|
|
|
+ }
|
|
|
+ if($data['id']==0){
|
|
|
+ $category = WebsiteCategory::where('website_id', $data['website_id'])
|
|
|
+ ->where('pid', 0)
|
|
|
+ ->pluck('aLIas_pinyin')
|
|
|
+ ->map(function ($alias) {
|
|
|
+ return "/{$alias}/:id";
|
|
|
+ })
|
|
|
+ ->values()
|
|
|
+ ->all();
|
|
|
+ }else{
|
|
|
+ $category = WebsiteCategory::where('website_id', $data['website_id'])
|
|
|
+ ->where('pid','!=', 0)
|
|
|
+ ->pluck('aLIas_pinyin')
|
|
|
+ ->map(function ($alias) {
|
|
|
+ return "/{$alias}/:id";
|
|
|
+ })
|
|
|
+ ->values()
|
|
|
+ ->all();
|
|
|
+ }
|
|
|
+ if (empty($category)) {
|
|
|
+ return Result::error("暂无此导航",0);
|
|
|
+ }
|
|
|
+ // $result = [];
|
|
|
+ return Result::success($category);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|