|
@@ -1132,6 +1132,7 @@ class NewsService implements NewsServiceInterface
|
|
$textArticles = [];
|
|
$textArticles = [];
|
|
// return Result::error("暂无此栏目",0);
|
|
// return Result::error("暂无此栏目",0);
|
|
}else{
|
|
}else{
|
|
|
|
+ $parent_alias = $category->aLIas_pinyin ? $category->aLIas_pinyin.'/' : null;
|
|
// return Result::success($website);
|
|
// return Result::success($website);
|
|
// 查询图片新闻
|
|
// 查询图片新闻
|
|
// 合并查询条件
|
|
// 合并查询条件
|
|
@@ -1162,7 +1163,7 @@ class NewsService implements NewsServiceInterface
|
|
'website_category.alias',
|
|
'website_category.alias',
|
|
'website_category.aLIas_pinyin'
|
|
'website_category.aLIas_pinyin'
|
|
)
|
|
)
|
|
- ->selectRaw("CONCAT(?, aLIas_pinyin, '/') as aLIas_pinyin", [$pinyin])
|
|
|
|
|
|
+ ->selectRaw("CONCAT(?, aLIas_pinyin) as aLIas_pinyin", [$parent_alias])
|
|
->orderBy('article.updated_at', 'desc')
|
|
->orderBy('article.updated_at', 'desc')
|
|
->limit($parentTextNum)
|
|
->limit($parentTextNum)
|
|
->get()
|
|
->get()
|
|
@@ -1184,7 +1185,7 @@ class NewsService implements NewsServiceInterface
|
|
'website_category.alias',
|
|
'website_category.alias',
|
|
'website_category.aLIas_pinyin'
|
|
'website_category.aLIas_pinyin'
|
|
)
|
|
)
|
|
- ->selectRaw("CONCAT(?, aLIas_pinyin, '/') as aLIas_pinyin", [$pinyin])
|
|
|
|
|
|
+ ->selectRaw("CONCAT(?, aLIas_pinyin ) as aLIas_pinyin", [$parent_alias])
|
|
->orderBy('article.updated_at', 'desc')
|
|
->orderBy('article.updated_at', 'desc')
|
|
->where('imgurl', '!=', '')
|
|
->where('imgurl', '!=', '')
|
|
->limit($parentImgNum)
|
|
->limit($parentImgNum)
|
|
@@ -1209,7 +1210,34 @@ class NewsService implements NewsServiceInterface
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ /**
|
|
|
|
+ *获取头条类新闻模块-合集
|
|
|
|
+ * @param array $data
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getWebsiteAllArticlett(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $input['id'] = $data['id'];
|
|
|
|
+ $input['website_id'] = $data['website_id'];
|
|
|
|
+ $data = json_decode($input['id'], true);
|
|
|
|
+ // 使用 array_map 处理每个元素
|
|
|
|
+ $result = array_map(function ($item) use ($input) {
|
|
|
|
+ list($parentCatId, $parentImgNum, $parentTextNum) = explode(',', $item['parent']);
|
|
|
|
+ $website = [
|
|
|
|
+ 'website_id' => $input['website_id']
|
|
|
|
+ ];
|
|
|
|
+ $category = WebsiteCategory::where('website_id', $input['website_id'])->pluck('category_id');
|
|
|
|
+ $category = array_values(array_unique($category->toArray()));
|
|
|
|
+ $placeid = isset($data['placeid']) && !empty($data['placeid']) ? $data['placeid'] - 1 : 0;
|
|
|
|
+ $where = [
|
|
|
|
+ 'status' => 1,
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ return $category;
|
|
|
|
+ }, $data); // 添加第二个参数 $data,确保 array_map 函数有两个参数
|
|
|
|
+
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|