|
@@ -204,7 +204,9 @@ class ClientService implements ClientServiceInterface
|
|
if ($imgSize > 0) {
|
|
if ($imgSize > 0) {
|
|
|
|
|
|
$imgArticles = Db::table('article')
|
|
$imgArticles = Db::table('article')
|
|
-
|
|
|
|
|
|
+ ->leftJoin('article_ignore', function ($join) use ($website_id) {
|
|
|
|
+ $join->on('article.id', '=', 'article_ignore.article_id')->where('article_ignore.website_id', '=', $website_id);
|
|
|
|
+ })->whereNull('article_ignore.article_id')
|
|
->whereRaw('MATCH(level_text) AGAINST(? IN NATURAL LANGUAGE MODE)', [$level])->where('status', 1)->whereIn('catid', $categoryIds)->whereNotNull('imgurl')->where('imgurl', '!=', '')->limit($imgSize)->orderBy('updated_at', 'desc')->get()->toArray();
|
|
->whereRaw('MATCH(level_text) AGAINST(? IN NATURAL LANGUAGE MODE)', [$level])->where('status', 1)->whereIn('catid', $categoryIds)->whereNotNull('imgurl')->where('imgurl', '!=', '')->limit($imgSize)->orderBy('updated_at', 'desc')->get()->toArray();
|
|
//拼接上拼音
|
|
//拼接上拼音
|
|
foreach ($imgArticles as $k => $v) {
|
|
foreach ($imgArticles as $k => $v) {
|
|
@@ -213,7 +215,11 @@ class ClientService implements ClientServiceInterface
|
|
}
|
|
}
|
|
//取出所有的子级的imgurl 为空的数据 ->whereNull('imgurl')
|
|
//取出所有的子级的imgurl 为空的数据 ->whereNull('imgurl')
|
|
if ($textSize > 0) {
|
|
if ($textSize > 0) {
|
|
- $textArticles = Db::table('article')->where('status', 1)->whereRaw('MATCH(level_text) AGAINST(? IN NATURAL LANGUAGE MODE)', [$level])->whereIn('catid', $categoryIds)->limit($textSize)->orderBy('updated_at', 'desc')->get()->toArray();
|
|
|
|
|
|
+ $textArticles = Db::table('article')->where('status', 1)
|
|
|
|
+ ->leftJoin('article_ignore', function ($join) use ($website_id) {
|
|
|
|
+ $join->on('article.id', '=', 'article_ignore.article_id')->where('article_ignore.website_id', '=', $website_id);
|
|
|
|
+ })->whereNull('article_ignore.article_id')
|
|
|
|
+ ->whereRaw('MATCH(level_text) AGAINST(? IN NATURAL LANGUAGE MODE)', [$level])->whereIn('catid', $categoryIds)->limit($textSize)->orderBy('updated_at', 'desc')->get()->toArray();
|
|
//拼接上拼音
|
|
//拼接上拼音
|
|
foreach ($textArticles as $k => $v) {
|
|
foreach ($textArticles as $k => $v) {
|
|
$textArticles[$k]->pinyin = $catiall[$v->catid][0] ?? '=====';
|
|
$textArticles[$k]->pinyin = $catiall[$v->catid][0] ?? '=====';
|