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

自助建站-ai会话-给模板添加导航

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

+ 4 - 3
app/JsonRpc/PublicRpcService.php

@@ -5075,9 +5075,10 @@ class PublicRpcService implements PublicRpcServiceInterface
                     $componentList[$key][$k] = $v ?? [];
                     if (isset($v['componentData']['level']) && (empty($v['componentData']['level']) || $v['componentData']['level'] == "")) {
                         $componentList[$key][$k]['componentData']['name'] = $all_cate[$cat_key]['alias'] ?? '';
-                        $category_arr = json_decode($all_cate[$cat_key]['real_category_arr_id'], true) ?? [];
-                        if(empty($category_arr)){
-                            $category_arr = json_decode($all_cate[$cat_key]['category_arr_id'], true) ?? [];
+                        if(empty($all_cate[$cat_key]['real_category_arr_id'])){
+                            $category_arr = json_decode($all_cate[$cat_key]['category_arr_id'] ?? [], true) ?? [];
+                        }else{
+                            $category_arr = json_decode($all_cate[$cat_key]['real_category_arr_id'] ?? [], true) ?? [];
                         }
                         $componentList[$key][$k]['componentData']['category_arr'] = $category_arr ?? [];
                         $componentList[$key][$k]['componentData']['category_id'] = $all_cate[$cat_key]['category_id'] ?? '';