feat: mobile文章首页
This commit is contained in:
@@ -32,7 +32,8 @@ class Article extends Common
|
||||
// 获取banner焦点图
|
||||
$banner = SysBannerItemModel::hasWhere('banner', [
|
||||
'language_id' => $this->lang_id,
|
||||
'unique_label' => 'BANNER_67f9fc71e27db'
|
||||
'unique_label' => 'BANNER_67f9fc71e27db',
|
||||
'at_platform' => request()->from
|
||||
])
|
||||
->type('image')
|
||||
->visible(['id', 'title', 'image', 'link'])
|
||||
@@ -58,7 +59,8 @@ class Article extends Common
|
||||
'id',
|
||||
'title',
|
||||
'desc',
|
||||
'image'
|
||||
'image',
|
||||
'release_time'
|
||||
])
|
||||
->withSearch(['title'], ['title' => $param['keywords']??null])
|
||||
->category($param['cid']??$categorys[0]['id'])
|
||||
@@ -67,8 +69,12 @@ class Article extends Common
|
||||
->paginate([
|
||||
'list_rows' => $param['size'],
|
||||
'page' => $param['page'],
|
||||
'query' => request()->param([
|
||||
'cid',
|
||||
'keywords',
|
||||
]) // 保留查询参数,防止分页丢失
|
||||
]);
|
||||
}
|
||||
}
|
||||
View::assign('articles', $articles??[]);
|
||||
|
||||
return View::fetch('index');
|
||||
|
||||
Reference in New Issue
Block a user