Browse Source

修改接口:获取并搜索 网站模板信息、自助建站-验证搭建网站

15313670163 9 hours ago
parent
commit
2d25c99c51
2 changed files with 15 additions and 8 deletions
  1. 2 2
      app/JsonRpc/PublicRpcService.php
  2. 13 6
      app/JsonRpc/WebsiteService.php

+ 2 - 2
app/JsonRpc/PublicRpcService.php

@@ -1307,14 +1307,14 @@ class PublicRpcService implements PublicRpcServiceInterface
             return Result::error('组件编号已存在!');
             return Result::error('组件编号已存在!');
 
 
         }
         }
-        $component_place = SectorPlace::where('sector_type',$sector['place_type'])->where('type_id',2)->where('sort_id',$data['sort_id'])->first();
+        $component_place = SectorPlace::where('sector_type',$sector['place_type'])
+        ->where('type_id',2)->where('sort_id',$data['sort_id'])->first();
         // return Result::success($component_place);
         // return Result::success($component_place);
          // 组件分类:2:资讯-轮播组件;3:资讯-推荐类组件;4:资讯-热点类组件;5:广告类组件;
          // 组件分类:2:资讯-轮播组件;3:资讯-推荐类组件;4:资讯-热点类组件;5:广告类组件;
         // 6:列表类组件;7:详情类组件;8:底部导航类组件;9:栏目资讯类组件;10:最新资讯类;11:导航栏类;',
         // 6:列表类组件;7:详情类组件;8:底部导航类组件;9:栏目资讯类组件;10:最新资讯类;11:导航栏类;',
         if(is_array($data['page_type']) && !empty($data['page_type'])){
         if(is_array($data['page_type']) && !empty($data['page_type'])){
             $page_type = array_values(array_map('intval',$data['page_type']));
             $page_type = array_values(array_map('intval',$data['page_type']));
             $data['page_type'] = json_encode($page_type,true);
             $data['page_type'] = json_encode($page_type,true);
-            
         }
         }
         $data['type_id'] = intval($data['type_id']);
         $data['type_id'] = intval($data['type_id']);
         $add_arr = [
         $add_arr = [

+ 13 - 6
app/JsonRpc/WebsiteService.php

@@ -1619,8 +1619,13 @@ class WebsiteService implements WebsiteServiceInterface
         //查询所有网站模板信息
         //查询所有网站模板信息
         $query = Website::where('website.status', 1)
         $query = Website::where('website.status', 1)
             ->leftJoin("website_template_info", "website_template_info.website_id", "website.id")
             ->leftJoin("website_template_info", "website_template_info.website_id", "website.id")
-            ->leftJoin("template", "template.id", "website_template_info.template_id")
-            ->leftJoin("template_class", "template_class.id", "template.template_class_id")
+            ->leftJoin("template", "template.template_id", "website_template_info.template_id")
+            ->leftJoin("template_class", "template_class.class_id", "template.template_class_id")
+            ->leftJoin('website_column', 'website_column.id', 'website.website_column_id')
+            ->leftJoin('website_column as parent_column', function ($join) {
+                $join->on('website_column.pid', '=', 'parent_column.id')
+                    ->where('website_column.pid', 2);
+            })
             ->select(
             ->select(
                 "website_template_info.id",
                 "website_template_info.id",
                 "template_class.name",
                 "template_class.name",
@@ -1631,6 +1636,8 @@ class WebsiteService implements WebsiteServiceInterface
                 "website_template_info.created_at",
                 "website_template_info.created_at",
                 "website_template_info.updated_at",
                 "website_template_info.updated_at",
                 "website_template_info.page_type",
                 "website_template_info.page_type",
+                'website_column.column_name',
+                'parent_column.column_name as parent_column_name',
                 DB::raw("COALESCE(website_template_info.status, 0) as template_status"),
                 DB::raw("COALESCE(website_template_info.status, 0) as template_status"),
                 "template.template_name"
                 "template.template_name"
             );
             );
@@ -1686,14 +1693,14 @@ class WebsiteService implements WebsiteServiceInterface
         if (empty($foot_type)) {
         if (empty($foot_type)) {
             return Result::error("请先关联底部导航池!", 0);
             return Result::error("请先关联底部导航池!", 0);
         }
         }
-        if (!in_array(1, $foot_type) ) {
-            $missingTypes[] = "列表型底部导航";
-        } 
+        // if (!in_array(1, $foot_type) ) {
+        //     $missingTypes[] = "列表型底部导航";
+        // }
         if (!in_array(0, $foot_type) ) {
         if (!in_array(0, $foot_type) ) {
             $missingTypes[] = "内容型底部导航";
             $missingTypes[] = "内容型底部导航";
         } 
         } 
         if (!empty($missingTypes)) {
         if (!empty($missingTypes)) {
-            $errorMessage = "请先添加" . implode(" 和 ", $missingTypes) . "!";
+            $errorMessage = "请先添加" . $missingTypes . "!";
             return Result::error($errorMessage, 0);
             return Result::error($errorMessage, 0);
         }
         }
         $result['foot_type'] = $foot_type;
         $result['foot_type'] = $foot_type;