Sfoglia il codice sorgente

建立接口:获取c端网站所有头底信息

15313670163 2 giorni fa
parent
commit
899d5e6706
2 ha cambiato i file con 42 aggiunte e 1 eliminazioni
  1. 41 1
      app/JsonRpc/WebsiteService.php
  2. 1 0
      app/JsonRpc/WebsiteServiceInterface.php

+ 41 - 1
app/JsonRpc/WebsiteService.php

@@ -2456,7 +2456,47 @@ class WebsiteService implements WebsiteServiceInterface
         }
         return Result::success($result);
     }
-
+    /**
+     * 获取网站栏目信息
+     * @param array $data
+     */
+    public function getWebsiteAllinfo(array $data): array
+    {
+        $website = Website::where('id',$data['website_id'])->where('status',1)->first();
+        if (empty($website)) {
+            return Result::error("暂无该网站",0); 
+        }
+        if(isset($data['website_id']) && !empty($data['website_id'])){
+            $website_head = Website::where('id',$data['website_id'])
+                ->where('status',1)
+                ->select('id', 'website_name', 'logo', 'title', 'keywords', 'description', 
+                'suffix', 'website_url','ad_key','api_url','login_url','weblog_url')
+                ->first();
+            if (empty($website_head)) {
+                return Result::error("找不到网站",0); 
+            }
+        }else{
+            return Result::error("参数错误",0);
+        }
+        $website_foot = WebsiteTemplateInfo::where('website_id',$data['website_id'])->first();
+        if (empty($website_foot)) {
+            return Result::error("暂无底部基础信息",0);
+        }
+        $website_head['website_url'] = $website_head['website_url'] ? json_decode($website_head['website_url']) : [];
+        $result['website_head'] =$website_head;
+        $result['website_foot'] = $website_foot;
+        
+        // return Result::success($result);
+        // 1:图片 2:文字 3:底部
+        $result['website_foot']['foot_cate'] = FooterCategory::where('website_id',$data['website_id'])->get()->all();
+        $result['website_foot']['link_img'] = Link::where('website_id',$data['website_id'])->where('type',1)->where('status',1)->limit($data['link_imgnum'])->orderBy('sort')->get()->all(); 
+        $result['website_foot']['link_text'] = Link::where('website_id',$data['website_id'])->where('type',2)->where('status',1)->limit($data['link_textnum'])->orderBy('sort')->get()->all();
+        $result['website_foot']['link_foot'] = Link::where('website_id',$data['website_id'])->where('type',3)->where('status',1)->limit($data['link_footnum'])->orderBy('sort')->get()->all();
+        if(empty($result)){
+            return Result::error("暂无此网站信息",0);
+        }
+        return Result::success($result);
+    }
     //20250212  网站标识
     public function addWebsiteGroup(array $data): array
     {

+ 1 - 0
app/JsonRpc/WebsiteServiceInterface.php

@@ -173,4 +173,5 @@ interface WebsiteServiceInterface
      */
     public function updateWebsiteStatus(array $data): array;
 
+    public function getWebsiteAllinfo(array $data): array;
 }