LiuJ 1 day ago
parent
commit
947b120d21
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/JsonRpc/NewsService.php

+ 2 - 0
app/JsonRpc/NewsService.php

@@ -1194,6 +1194,7 @@ class NewsService implements NewsServiceInterface
       ->where('article.status', 1)
       ->where('article.status', 1)
       ->where('website_category.website_id', $data['website_id'])
       ->where('website_category.website_id', $data['website_id'])
       ->select('article.id', 'article.title', 'article.catid', 'article.imgurl', 'article.hits', 'article.created_at', 'website_category.alias', 'website_category.alias_pinyin', 'website_category.website_id')
       ->select('article.id', 'article.title', 'article.catid', 'article.imgurl', 'article.hits', 'article.created_at', 'website_category.alias', 'website_category.alias_pinyin', 'website_category.website_id')
+      ->orderByRaw("FIELD(article.id, " . implode(',', $commend_ids) . ")")
       // ->orderBy('article.updated_at', 'desc')
       // ->orderBy('article.updated_at', 'desc')
       ->limit(5)
       ->limit(5)
       ->get();
       ->get();
@@ -1202,6 +1203,7 @@ class NewsService implements NewsServiceInterface
     $result['website_name'] = $category['website_name'] ?? "";
     $result['website_name'] = $category['website_name'] ?? "";
     $result['suffix'] = $category['suffix'] ?? "";
     $result['suffix'] = $category['suffix'] ?? "";
     $result['commendArticle'] = $commendArticle;
     $result['commendArticle'] = $commendArticle;
+    $result['commend_ids'] = $commend_ids;
     return Result::success($result);
     return Result::success($result);
   }
   }