|
@@ -3,6 +3,7 @@
|
|
|
namespace App\Http\Controllers\Web\Content;
|
|
|
|
|
|
use App\Http\Controllers\Web\WebBaseController;
|
|
|
+use App\Services\Common\HotWordService;
|
|
|
use App\Services\Content\ArticleService;
|
|
|
use App\Services\Content\ArticleCategoryService;
|
|
|
use App\Services\Content\AdService;
|
|
@@ -18,18 +19,20 @@ class ArticleController extends WebBaseController
|
|
|
protected $articleCategoryService;
|
|
|
protected $adService;
|
|
|
protected $navigationService;
|
|
|
+ protected $hotWordService;
|
|
|
|
|
|
/**
|
|
|
* ArticleController constructor.
|
|
|
* @param $articleService
|
|
|
* @param $articleCategoryService
|
|
|
*/
|
|
|
- public function __construct(ArticleService $articleService, ArticleCategoryService $articleCategoryService, AdService $adService, NavigationService $navigationService)
|
|
|
+ public function __construct(ArticleService $articleService, ArticleCategoryService $articleCategoryService, AdService $adService, NavigationService $navigationService, HotWordService $hotWordService)
|
|
|
{
|
|
|
$this->articleService = $articleService;
|
|
|
$this->articleCategoryService = $articleCategoryService;
|
|
|
$this->adService = $adService;
|
|
|
$this->navigationService = $navigationService;
|
|
|
+ $this->hotWordService = $hotWordService;
|
|
|
}
|
|
|
|
|
|
public function index(Request $request, $id = '57', $num = '8', $focus = '3', $recommend = '4', $other_num = '5')
|
|
@@ -110,6 +113,9 @@ class ArticleController extends WebBaseController
|
|
|
}
|
|
|
$this->putSeoData('article_cate', $article_cate);
|
|
|
|
|
|
+ //热词
|
|
|
+ $hotWords = $this->hotWordService->getHotWords(['type' => 4], 'list_order desc,w_hot desc', 10); //热门关键词
|
|
|
+
|
|
|
$return_data = [
|
|
|
'articles' => $lists,
|
|
|
'categorys' => $categorys,
|
|
@@ -121,6 +127,7 @@ class ArticleController extends WebBaseController
|
|
|
'now_cate' => $now_cate,
|
|
|
'categorys_child' => $categorys_child,
|
|
|
'bread' => $bread,
|
|
|
+ 'hotwords' => $hotWords,
|
|
|
];
|
|
|
|
|
|
return view('app.content.article.list', $return_data);
|