|
@@ -1405,7 +1405,7 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
$category = WebsiteCategory::where('website_id',$data['website_id'])->where('pid',$data['pid'])->pluck('category_id')->all();
|
|
|
// return Result::success($category);
|
|
|
if (empty($category)) {
|
|
|
- // return Result::error("暂无二级导航",0);
|
|
|
+ return Result::error("暂无二级导航",0);
|
|
|
}
|
|
|
$query = Category::whereIn('id', $category);
|
|
|
if (isset($data['cityid']) && !empty($data['cityid'])) {
|
|
@@ -1478,5 +1478,27 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
}
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
-
|
|
|
+ /*
|
|
|
+ * 搜索网站二级导航
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ * */
|
|
|
+ public function getOneWebsiteCategory(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);
|
|
|
+ }
|
|
|
+ $result = WebsiteCategory::where('website_id',$data['website_id'])->where('category_id',$data['category_id'])->select('category_id','name')->first();
|
|
|
+ // return Result::success($category);
|
|
|
+ if (empty($result)) {
|
|
|
+ return Result::error("暂无此导航",0);
|
|
|
+ }
|
|
|
+ // department_id
|
|
|
+ }else{
|
|
|
+ return Result::error("参数错误",0);
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
}
|