From d2c755fd0a21d0bc8c99285626cf97896e93cb99 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Sat, 12 Apr 2025 17:57:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=97=AE=E7=AD=94=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Faq.php | 52 +++++++++++++++++++++ app/index/route/route.php | 6 +++ app/index/view/faq/index.html | 34 ++++++++++++++ public/static/index/css/{fq.css => faq.css} | 41 +++------------- 4 files changed, 98 insertions(+), 35 deletions(-) create mode 100644 app/index/controller/Faq.php create mode 100644 app/index/view/faq/index.html rename public/static/index/css/{fq.css => faq.css} (54%) diff --git a/app/index/controller/Faq.php b/app/index/controller/Faq.php new file mode 100644 index 00000000..91d4774a --- /dev/null +++ b/app/index/controller/Faq.php @@ -0,0 +1,52 @@ +param([ + 'page/d' => 1, + 'size/d' => 12 + ]); + + // 获取banner焦点图 + $banner = SysBannerItemModel::hasWhere('banner', [ + 'language_id' => $this->lang_id, + 'unique_label' => 'BANNER_67fa37f30e151' + ]) + ->type('image') + ->visible(['id', 'title', 'image', 'link']) + ->find(); + View::assign('banner', $banner); + + // 获取问答列表 + $faq = FaqModel::field([ + 'id', + 'image', + 'question', + 'answer', + ]) + ->language($this->lang_id) + ->order(['sort' => 'asc', 'id' => 'desc']) + ->paginate([ + 'list_rows' => $param['size'], + 'page' => $param['page'], + ]); + View::assign('faq', $faq); + + return View::fetch('index'); + } +} diff --git a/app/index/route/route.php b/app/index/route/route.php index 9d860a38..953c4436 100644 --- a/app/index/route/route.php +++ b/app/index/route/route.php @@ -34,5 +34,11 @@ Route::group('article', function() { Route::post('comment', 'Article/comment'); }); +// 问答中心 +Route::group('faq', function() { + // 问答列表页 + Route::get('index', 'Faq/index'); +}); + // 数据迁移 Route::get('/data/migration', 'DataMigration/index'); diff --git a/app/index/view/faq/index.html b/app/index/view/faq/index.html new file mode 100644 index 00000000..fc161829 --- /dev/null +++ b/app/index/view/faq/index.html @@ -0,0 +1,34 @@ +{extend name="public/base" /} +{block name="title"} +