소스 검색

三农资讯网站建立获取某个栏目的接口

15313670163 2 달 전
부모
커밋
f0fb32cd47
3개의 변경된 파일26개의 추가작업 그리고 2개의 파일을 삭제
  1. 24 2
      app/JsonRpc/WebsiteService.php
  2. 2 0
      app/JsonRpc/WebsiteServiceInterface.php
  3. 0 0
      runtime/container/scan.cache

+ 24 - 2
app/JsonRpc/WebsiteService.php

@@ -1405,7 +1405,7 @@ class WebsiteService implements WebsiteServiceInterface
             $category = WebsiteCategory::where('website_id',$data['website_id'])->where('pid',$data['pid'])->pluck('category_id')->all();
             // return Result::success($category);
             if (empty($category)) {
-                // return Result::error("暂无二级导航",0); 
+                return Result::error("暂无二级导航",0); 
             }
             $query = Category::whereIn('id', $category);
             if (isset($data['cityid']) && !empty($data['cityid'])) {
@@ -1478,5 +1478,27 @@ class WebsiteService implements WebsiteServiceInterface
         }
         return Result::success($result);
     }
-    
+     /*
+     * 搜索网站二级导航
+     * @param array $data
+     * @return array
+     * */
+    public function getOneWebsiteCategory(array $data): array
+    {
+        if(isset($data['website_id']) &&!empty($data['website_id'])){
+            $website = Website::where('id',$data['website_id'])->where('status',1)->first(); 
+            if (empty($website)) {
+                return Result::error("暂无该网站",0); 
+            }
+            $result = WebsiteCategory::where('website_id',$data['website_id'])->where('category_id',$data['category_id'])->select('category_id','name')->first();
+            // return Result::success($category);
+            if (empty($result)) {
+                return Result::error("暂无此导航",0); 
+            }            
+            // department_id
+        }else{
+            return Result::error("参数错误",0);
+        }
+        return Result::success($result);
+    }
 }

+ 2 - 0
app/JsonRpc/WebsiteServiceInterface.php

@@ -89,4 +89,6 @@ interface WebsiteServiceInterface
     public function getWebsiteFooterCategoryInfo(array $data): array;
     public function selectWebsiteCategory(array $data): array;
     public function getWebsiteCategoryHead(array $data): array;
+
+    public function getOneWebsiteCategory(array $data): array;
 }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
runtime/container/scan.cache


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.