|
@@ -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);
|
|
|
}
|
|
|
/**
|