|
@@ -772,6 +772,7 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
} else {
|
|
} else {
|
|
|
$pidMap = $pidResults->keyBy('pid');
|
|
$pidMap = $pidResults->keyBy('pid');
|
|
|
$result->each(function ($record) use ($pidMap) {
|
|
$result->each(function ($record) use ($pidMap) {
|
|
|
|
|
+ $record->aLIas_pinyin = $record->path;
|
|
|
if ($pidMap->has($record->category_id)) {
|
|
if ($pidMap->has($record->category_id)) {
|
|
|
$pidResult = $pidMap->get($record->category_id);
|
|
$pidResult = $pidMap->get($record->category_id);
|
|
|
$record->chilid_id = $pidResult->category_id;
|
|
$record->chilid_id = $pidResult->category_id;
|
|
@@ -2160,6 +2161,7 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
if (empty($result)) {
|
|
if (empty($result)) {
|
|
|
return Result::error("暂无导航", 0);
|
|
return Result::error("暂无导航", 0);
|
|
|
}
|
|
}
|
|
|
|
|
+ $result['aLIas_pinyin'] = $result['path'] ?? '';
|
|
|
$result['website_name'] = $website['website_name'] ?? '';
|
|
$result['website_name'] = $website['website_name'] ?? '';
|
|
|
$result['suffix'] = $website['suffix'] ?? '';
|
|
$result['suffix'] = $website['suffix'] ?? '';
|
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
@@ -2181,8 +2183,10 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
if (empty($category)) {
|
|
if (empty($category)) {
|
|
|
return Result::error("暂无此导航", 0);
|
|
return Result::error("暂无此导航", 0);
|
|
|
}
|
|
}
|
|
|
- $category['children_count'] = WebsiteCategory::where('website_id', $data['website_id'])->where('pid', $data['category_id'])->count();
|
|
|
|
|
- $parent = WebsiteCategory::where('website_id', $data['website_id'])->where('category_id', $category['pid'])->select('category_id as parent_id', 'alias as parent_name', 'aLIas_pinyin')->first();
|
|
|
|
|
|
|
+ $category['children_count'] = WebsiteCategory::where('website_id',$data['website_id'])->where('pid',$data['category_id'])->count();
|
|
|
|
|
+ $parent = WebsiteCategory::where('website_id',$data['website_id'])->where('category_id',$category['pid'])->select('category_id as parent_id','alias as parent_name','aLIas_pinyin')->first();
|
|
|
|
|
+ // return Result::success($parent);
|
|
|
|
|
+ $category['aLIas_pinyin'] = $category['path'] ?? '';
|
|
|
$category['parent_id'] = $parent['parent_id'] ?? '';
|
|
$category['parent_id'] = $parent['parent_id'] ?? '';
|
|
|
$category['parent_pinyin'] = $parent['aLIas_pinyin'] ?? '';
|
|
$category['parent_pinyin'] = $parent['aLIas_pinyin'] ?? '';
|
|
|
$category['parent_name'] = $parent['parent_name'] ?? '';
|
|
$category['parent_name'] = $parent['parent_name'] ?? '';
|