diff --git a/application/plugins/view/commonrightnavigation/index/content.html b/application/plugins/view/commonrightnavigation/index/content.html
index 9814b2bf1..e222e2939 100755
--- a/application/plugins/view/commonrightnavigation/index/content.html
+++ b/application/plugins/view/commonrightnavigation/index/content.html
@@ -160,7 +160,7 @@
-
+
@@ -168,7 +168,7 @@
-
+
diff --git a/application/service/AnswerService.php b/application/service/AnswerService.php
index 92345b88c..c5d03ab11 100755
--- a/application/service/AnswerService.php
+++ b/application/service/AnswerService.php
@@ -77,12 +77,20 @@ class AnswerService
$v['is_show_text'] = $common_is_show_list[$v['is_show']]['name'];
}
+ // 回复时间
+ if(isset($v['reply_time']))
+ {
+ $reply_time = $v['reply_time'];
+ $v['reply_time'] = empty($reply_time) ? '' : date('Y-m-d H:i:s', $reply_time);
+ $v['reply_time_date'] = empty($reply_time) ? '' : date('Y-m-d', $reply_time);
+ }
+
// 创建时间
if(isset($v['add_time']))
{
$add_time = $v['add_time'];
- $v['add_time'] = date('Y-m-d H:i:s', $add_time);
- $v['add_time_date'] = date('Y-m-d', $add_time);
+ $v['add_time'] = empty($add_time) ? '' : date('Y-m-d H:i:s', $add_time);
+ $v['add_time_date'] = empty($add_time) ? '' : date('Y-m-d', $add_time);
}
// 更新时间
@@ -167,15 +175,24 @@ class AnswerService
// 参数校验
$p = [
[
- 'checked_type' => 'isset',
+ 'checked_type' => 'length',
'key_name' => 'name',
- 'error_msg' => '联系人有误',
+ 'checked_data' => '30',
+ 'is_checked' => 1,
+ 'error_msg' => '联系人最多30个字符',
],
[
'checked_type' => 'isset',
'key_name' => 'tel',
'error_msg' => '联系电话有误',
],
+ [
+ 'checked_type' => 'length',
+ 'key_name' => 'title',
+ 'checked_data' => '60',
+ 'is_checked' => 1,
+ 'error_msg' => '标题最多60个字符',
+ ],
[
'checked_type' => 'empty',
'key_name' => 'content',
@@ -193,6 +210,7 @@ class AnswerService
'user_id' => isset($params['user']['id']) ? intval($params['user']['id']) : 0,
'name' => isset($params['name']) ? $params['name'] : '',
'tel' => isset($params['tel']) ? $params['tel'] : '',
+ 'title' => isset($params['title']) ? $params['title'] : '',
'content' => $params['content'],
'add_time' => time(),
];
@@ -315,9 +333,10 @@ class AnswerService
}
// 更新问答
$data = [
- 'reply' => $params['reply'],
- 'is_reply' => 1,
- 'upd_time' => time()
+ 'reply' => $params['reply'],
+ 'is_reply' => 1,
+ 'reply_time' => time(),
+ 'upd_time' => time()
];
if(Db::name('Answer')->where($where)->update($data))
{
diff --git a/public/static/plugins/css/answers/index.css b/public/static/plugins/css/answers/index.css
index d83089144..9997f4284 100644
--- a/public/static/plugins/css/answers/index.css
+++ b/public/static/plugins/css/answers/index.css
@@ -112,4 +112,17 @@
margin-top: 10px;
box-shadow: none;
-webkit-box-shadow: none;
+}
+.plugins-answers-detail .am-panel-warning {
+ background: #fff7ef;
+}
+.plugins-answers-detail .am-panel-success {
+ background: #f2fff1;
+}
+.plugins-answers-detail h2 {
+ margin-bottom: 5px;
+ font-weight: 500;
+}
+.plugins-answers-detail .base .reply-content {
+ margin-top: 5px;
}
\ No newline at end of file