فهرست منبع

Merge branch 'web_sannong_fr'

15313670163 5 روز پیش
والد
کامیت
3b77f02c43
1فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 5 4
      app/JsonRpc/NewsService.php

+ 5 - 4
app/JsonRpc/NewsService.php

@@ -2460,7 +2460,7 @@ class NewsService implements NewsServiceInterface
         $parent_categpory = WebsiteCategory::where('website_id', $data['website_id'])->where('category_id',$category['pid'])->orderBy('sort')->first(['aLias_pinyin']);
         $parent_pinyin = $parent_categpory ? $parent_categpory->aLias_pinyin ?? '' : '';
         $category_pinyin = $category ? $category->aLias_pinyin : '';
-        $pinyin = $parent_pinyin . '/' . $category_pinyin ;
+        $pinyin =$category_pinyin ? $parent_pinyin . '/' . $category_pinyin ?? '' : '' ;
         $categorys = WebsiteCategory::where('website_id', $data['website_id'])
             ->where('pid',$category['pid'])
             ->select(
@@ -2492,14 +2492,15 @@ class NewsService implements NewsServiceInterface
             ->limit($data['pageSize'])
             ->offset(($data['page']-1)*$data['pageSize'])
             ->get()->all();
-        if(empty($Book)){
-            return Result::error("查询失败", 0);
-        }
+        
         $result = [
             'category' => $categorys,
             'books' => $Book,
             'count' =>$count,
         ];
+        // if(empty($result)){
+        //     return Result::error("查询失败", 0);
+        // }
         return Result::success($result);
     }
     /**