Bläddra i källkod

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

15313670163 2 månader sedan
förälder
incheckning
f0fb32cd47

+ 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;
 }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
runtime/container/scan.cache


Vissa filer visades inte eftersom för många filer har ändrats