From 0d7ad4e712dda80ece9c1d80e57c7c3151a7a4d6 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Sun, 7 Apr 2019 22:27:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E7=AD=94=E5=AD=97=E8=8A=82=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Answer.php | 13 ++++++++++ .../admin/view/default/answer/index.html | 16 ++++++++---- .../admin/view/default/answer/save_info.html | 4 +-- .../plugins/view/answers/index/detail.html | 4 +-- .../plugins/view/answers/index/popup.html | 2 +- application/service/AnswerService.php | 26 ++++++++++++++++--- public/static/admin/default/css/answer.css | 2 +- 7 files changed, 52 insertions(+), 15 deletions(-) diff --git a/application/admin/controller/Answer.php b/application/admin/controller/Answer.php index 20b8fb931..0621a18d2 100755 --- a/application/admin/controller/Answer.php +++ b/application/admin/controller/Answer.php @@ -116,6 +116,19 @@ class Answer extends Common 'field' => '*', ); $ret = AnswerService::AnswerList($data_params); + + // 内容 + if(!empty($ret['data'][0]['content'])) + { + $ret['data'][0]['content'] = str_replace('
', "\n", $ret['data'][0]['content']); + } + + // 回复内容 + if(!empty($ret['data'][0]['reply'])) + { + $ret['data'][0]['reply'] = str_replace('
', "\n", $ret['data'][0]['reply']); + } + $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; } $this->assign('data', $data); diff --git a/application/admin/view/default/answer/index.html b/application/admin/view/default/answer/index.html index 62ba7ee89..1a16f78ef 100755 --- a/application/admin/view/default/answer/index.html +++ b/application/admin/view/default/answer/index.html @@ -97,10 +97,16 @@ {{/if}} {{$v.title}} - {{$v.content}} - + +
+ {{$v.content|raw}} +
+ + {{if !empty($v['reply'])}} - {{$v.reply}} +
+ {{$v.reply|raw}} +
{{else /}} 未回复 {{/if}} @@ -160,7 +166,7 @@
{{if empty($v['title'])}}未填写{{else /}}{{$v.title}}{{/if}}
内容
-
{{$v.content}}
+
{{$v.content|raw}}
是否显示
{{if empty($v['is_show_text'])}}未填写{{else /}}{{$v.is_show_text}}{{/if}}
@@ -168,7 +174,7 @@
回复内容
{{if !empty($v['reply'])}} - {{$v.reply}} + {{$v.reply|raw}} {{else /}} 未回复 {{/if}} diff --git a/application/admin/view/default/answer/save_info.html b/application/admin/view/default/answer/save_info.html index e5766ae59..5199ccf9e 100644 --- a/application/admin/view/default/answer/save_info.html +++ b/application/admin/view/default/answer/save_info.html @@ -33,11 +33,11 @@
- +
- +
diff --git a/application/plugins/view/answers/index/detail.html b/application/plugins/view/answers/index/detail.html index 38a9c9a13..e13513e2e 100644 --- a/application/plugins/view/answers/index/detail.html +++ b/application/plugins/view/answers/index/detail.html @@ -24,7 +24,7 @@ {{/if}}

阅读数:{{$plugins_answers_detail.data.access_count}}

-
{{$plugins_answers_detail.data.content}}
+
{{$plugins_answers_detail.data.content|raw}}