Просмотр исходного кода

修改c端接口:获取栏目、获取某个栏目、获取栏目的seo

rkljw 4 месяцев назад
Родитель
Сommit
368cf9ced5
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      app/JsonRpc/WebsiteService.php

+ 3 - 0
app/JsonRpc/WebsiteService.php

@@ -685,6 +685,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;
@@ -1534,6 +1535,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);
@@ -1558,6 +1560,7 @@ class WebsiteService implements WebsiteServiceInterface
             $category['children_count'] = WebsiteCategory::where('website_id',$data['website_id'])->where('pid',$data['category_id'])->count();
             $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();
             $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);
             // 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'] ?? '';