feat: mobile文章首页

This commit is contained in:
2025-06-05 16:34:23 +08:00
parent 2ce5ef5169
commit cd549aa32b
3 changed files with 78 additions and 3 deletions

View File

@@ -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');