|
@@ -585,14 +585,14 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
|
|
|
// return Result::success($data);
|
|
// return Result::success($data);
|
|
$pid = $data['pid'] ?? 0;
|
|
$pid = $data['pid'] ?? 0;
|
|
- $result = District::leftJoin('district as district2','district.pid','=','district2.id')
|
|
|
|
- ->where('district.pid',$pid)
|
|
|
|
- ->where('district.status',1)
|
|
|
|
- ->select('district.*','district2.name as pid_name')
|
|
|
|
- ->orderBy('district.code')->get();
|
|
|
|
- if(empty($result)){
|
|
|
|
- return Result::error("未查询到此地区",0);
|
|
|
|
- }else{
|
|
|
|
|
|
+ $result = District::leftJoin('district as district2', 'district.pid', '=', 'district2.id')
|
|
|
|
+ ->where('district.pid', $pid)
|
|
|
|
+ ->where('district.status', 1)
|
|
|
|
+ ->select('district.*', 'district2.name as pid_name')
|
|
|
|
+ ->orderBy('district.code')->get();
|
|
|
|
+ if (empty($result)) {
|
|
|
|
+ return Result::error("未查询到此地区", 0);
|
|
|
|
+ } else {
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2304,13 +2304,32 @@ class WebsiteService implements WebsiteServiceInterface
|
|
if (isset($data['type']) && !empty($data['type'])) {
|
|
if (isset($data['type']) && !empty($data['type'])) {
|
|
array_push($where, ['type', '=', $data['type']]);
|
|
array_push($where, ['type', '=', $data['type']]);
|
|
}
|
|
}
|
|
- $list = WebsiteCategory::query()->where($where)->get();
|
|
|
|
|
|
+ // 根据站点和type获取websiteCategory 中的id
|
|
|
|
+ $websiteCategoryids = WebsiteCategory::query()
|
|
|
|
+ ->where('website_id', '=', $data['website_id'])
|
|
|
|
+ ->where('type', '=', $data['type'])
|
|
|
|
+ ->pluck('category_arr_id')->toArray();
|
|
|
|
+ var_dump($websiteCategoryids, '------获取websiteCategory 中的id');
|
|
|
|
+ //合并去重
|
|
|
|
+ $category_ids = [];
|
|
|
|
+ foreach ($websiteCategoryids as $key => $value) {
|
|
|
|
+ $v = json_decode($value, true);
|
|
|
|
+ $category_ids = array_unique(array_merge($category_ids, $v));
|
|
|
|
+ }
|
|
|
|
+ // var_dump($category_ids, '------获取websiteCategory 中的id');
|
|
|
|
+ //根据pid取出所有的websiteCategory 中的id
|
|
|
|
+ $list = WebsiteCategory::query()
|
|
|
|
+ ->where('website_id', '=', $data['website_id'])
|
|
|
|
+ ->where('pid', '=', $data['pid'])
|
|
|
|
+ ->whereIn('category_id', $category_ids)
|
|
|
|
+ ->get();
|
|
if (empty($list)) {
|
|
if (empty($list)) {
|
|
return Result::error("获取失败", 0);
|
|
return Result::error("获取失败", 0);
|
|
} else {
|
|
} else {
|
|
return Result::success($list);
|
|
return Result::success($list);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
// 20250307 根据网站标识获和导航获取站点
|
|
// 20250307 根据网站标识获和导航获取站点
|
|
|
|
|
|
public function getWebsiteNavPoolSite(array $data): array
|
|
public function getWebsiteNavPoolSite(array $data): array
|