LiuJ 4 месяцев назад
Родитель
Сommit
bbe37b1d2b
1 измененных файлов с 6 добавлено и 5 удалено
  1. 6 5
      app/JsonRpc/WebsiteService.php

+ 6 - 5
app/JsonRpc/WebsiteService.php

@@ -1829,6 +1829,7 @@ class WebsiteService implements WebsiteServiceInterface
     public function getWebsiteAllCategory(array $data): array
     {
         $where = [];
+        var_dump($data, '---1');
         if (isset($data['website_id']) && !empty($data['website_id'])) {
             array_push($where, ['website_category.website_id', '=', $data['website_id']]);
         }
@@ -1842,12 +1843,13 @@ class WebsiteService implements WebsiteServiceInterface
         //            array_push($where, ['category.department_id', '=', $data['department_id']]);
         //        }
         //        if (isset($data['city_id']) && !empty($data['city_id'])) {
-        //            array_push($where, ['category.city_id', '=', $data['city_id']]);
+        //            array_push($where, ['category.city_id', '=', $data['city_id']]);  
         //        }
-
-        if (isset($data['is_show']) && !empty($data['is_show'])) {
+        if (isset($data['is_show'])) {
             array_push($where, ['website_category.is_show', '=', $data['is_show']]);
         }
+
+        var_dump($where, '---2');
         $result_real = WebsiteCategory::where($where)
             // ->where('website_category.is_show', 1) //显示
             ->whereNotNull('website_category.real_pid') //只显示顶级
@@ -1881,11 +1883,10 @@ class WebsiteService implements WebsiteServiceInterface
             ->orderBy("updated_at", "desc")
             ->get()->toArray();
         $result = array_merge($result, $result_real);
-        var_dump($result, '-----------1-');
+        // var_dump($result, '-----------1-');
         if (empty($result)) {
             return Result::error("没有数据", 0);
         }
-
         if ($result) {
             return Result::success($result);
         } else {