feat: 问答中心

This commit is contained in:
2025-04-12 17:57:16 +08:00
parent 03b7e0d288
commit d2c755fd0a
4 changed files with 98 additions and 35 deletions

View File

@@ -0,0 +1,52 @@
<?php
declare (strict_types = 1);
namespace app\index\controller;
use app\index\model\FaqModel;
use app\index\model\SysBannerItemModel;
use think\facade\View;
/**
* 问答中心控制器
*/
class Faq extends Common
{
/**
* 问答列表
*/
public function index()
{
$param = request()->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');
}
}

View File

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

View File

@@ -0,0 +1,34 @@
{extend name="public/base" /}
{block name="title"}
<title>常见FQ_下载与服务_中文官网帮助信息_ORICO/奥睿科官网</title>
{/block}
{block name="style"}
<link rel="stylesheet" href="__CSS__/faq.css">
{/block}
{block name="main"}
<div class="orico_Page_fq">
<!--内容 -->
<div class="img-responsive">
<img src="{$banner.image}" />
</div>
<div class="fqMain">
{notempty name="faq"}
<ul class="Table-Row">
{volist name="faq" id="vo"}
<li class="Table-Cell">
<div class="img-responsive">
<img src="{$vo.image}" />
</div>
<div class="faq-all-text">
<div class="faq-title">{$vo.question}</div>
<div class="faq-des">{$vo.answer|raw}</div>
</div>
</li>
{/volist}
</ul>
<!-- 分页-->
<div >{$faq|raw}</div>
{/notempty}
</div>
</div>
{/block}