|
|
|
@ -26,6 +26,7 @@ class ArticleController extends Controller |
|
|
|
|
'slug', 'author', 'description', |
|
|
|
|
'cover', 'is_top', 'created_at' |
|
|
|
|
) |
|
|
|
|
->orderBy('is_top', 'desc') |
|
|
|
|
->orderBy('created_at', 'desc') |
|
|
|
|
->with(['category', 'tags']) |
|
|
|
|
->paginate(10); |
|
|
|
@ -177,6 +178,7 @@ class ArticleController extends Controller |
|
|
|
|
|
|
|
|
|
public function search(Request $request, Article $articleModel) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if (Agent::isRobot()) { |
|
|
|
|
abort(404); |
|
|
|
|
} |
|
|
|
@ -184,11 +186,11 @@ class ArticleController extends Controller |
|
|
|
|
$wd = clean($request->input('wd')); |
|
|
|
|
$id = $articleModel->searchArticleGetId($wd); |
|
|
|
|
|
|
|
|
|
$articles = Article::select( |
|
|
|
|
$articles = Article::select([ |
|
|
|
|
'id', 'category_id', 'title', |
|
|
|
|
'author', 'description', 'cover', |
|
|
|
|
'is_top', 'created_at' |
|
|
|
|
) |
|
|
|
|
]) |
|
|
|
|
->whereIn('id', $id) |
|
|
|
|
->orderBy('created_at', 'desc') |
|
|
|
|
->with(['category', 'tags']) |
|
|
|
|