|
@@ -898,7 +898,7 @@ class NewsService implements NewsServiceInterface
|
|
'website_id' => $input['website_id'],
|
|
'website_id' => $input['website_id'],
|
|
];
|
|
];
|
|
// 查询栏目名称
|
|
// 查询栏目名称
|
|
- $category = WebsiteCategory::where('category_id', $parentCatId)->where($website)->first(['alias', 'category_id']);
|
|
|
|
|
|
+ $category = WebsiteCategory::where('category_id', $parentCatId)->where($website)->first(['alias', 'category_id','aLIas_pinyin']);
|
|
if(empty($category)){
|
|
if(empty($category)){
|
|
$imgArticles = [];
|
|
$imgArticles = [];
|
|
$textArticles = [];
|
|
$textArticles = [];
|
|
@@ -921,17 +921,19 @@ class NewsService implements NewsServiceInterface
|
|
'alias' => $category ? $category->alias : null,
|
|
'alias' => $category ? $category->alias : null,
|
|
'category_id' => $parentCatId,
|
|
'category_id' => $parentCatId,
|
|
'imgnum' => $imgArticles,
|
|
'imgnum' => $imgArticles,
|
|
- 'textnum' => $textArticles
|
|
|
|
|
|
+ 'textnum' => $textArticles,
|
|
|
|
+ 'pinyin' => $category->aLIas_pinyin ?? '',
|
|
];
|
|
];
|
|
|
|
|
|
if (!empty($item['child']) && $item['child'] != "") {
|
|
if (!empty($item['child']) && $item['child'] != "") {
|
|
// 查询第一个pid等于parent中第一个参数的category来获取child的category_id
|
|
// 查询第一个pid等于parent中第一个参数的category来获取child的category_id
|
|
- $childCategory = WebsiteCategory::where('pid', $parentCatId)->where($website)->first();
|
|
|
|
|
|
+ $childCategory = WebsiteCategory::where('pid', $parentCatId)->where($website)->select('category_id','alias','aLIas_pinyin')->get()->all();
|
|
if ($childCategory) {
|
|
if ($childCategory) {
|
|
list($childCatId, $childImgNum, $childTextNum) = explode(',', $item['child']);
|
|
list($childCatId, $childImgNum, $childTextNum) = explode(',', $item['child']);
|
|
|
|
|
|
// 查询子栏目名称
|
|
// 查询子栏目名称
|
|
- $childCategoryInfo = WebsiteCategory::where('category_id', $childCatId)->where($website)->first(['alias', 'category_id']);
|
|
|
|
|
|
+ $childCategoryInfo = WebsiteCategory::where('category_id', $childCatId)->where($website)->first(['alias', 'category_id','aLIas_pinyin']);
|
|
|
|
+ // $childAllCartegory = WebsiteCategory::where('pid', $childCatId)->where($website)->first(['category_id']);
|
|
if(empty($childCategoryInfo)){
|
|
if(empty($childCategoryInfo)){
|
|
$childImgArticles = [];
|
|
$childImgArticles = [];
|
|
$childTextArticles = [];
|
|
$childTextArticles = [];
|
|
@@ -954,9 +956,12 @@ class NewsService implements NewsServiceInterface
|
|
$resultItem['child'] = [
|
|
$resultItem['child'] = [
|
|
'alias' => $childCategoryInfo ? $childCategoryInfo->alias : null,
|
|
'alias' => $childCategoryInfo ? $childCategoryInfo->alias : null,
|
|
'category_id' => $childCatId,
|
|
'category_id' => $childCatId,
|
|
|
|
+ 'all_childcat' => $childCategory,
|
|
'imgnum' => $childImgArticles,
|
|
'imgnum' => $childImgArticles,
|
|
- 'textnum' => $childTextArticles
|
|
|
|
|
|
+ 'textnum' => $childTextArticles,
|
|
|
|
+ 'pinyin' => $childCategoryInfo->aLIas_pinyin?? '',
|
|
];
|
|
];
|
|
|
|
+ // $resultItem['pinyin'] = $childCategoryInfo->aLIas_pinyin ?? '';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|