diff --git a/application/admin/controller/Answer.php b/application/admin/controller/Answer.php
index 7648b3dda..67a3f0065 100755
--- a/application/admin/controller/Answer.php
+++ b/application/admin/controller/Answer.php
@@ -53,7 +53,7 @@ class Answer extends Common
$params = input();
// 分页
- $number = 10;
+ $number = MyC('admin_page_number', 10, true);
// 条件
$where = AnswerService::AnswerListWhere($params);
diff --git a/application/common.php b/application/common.php
index be5a6fc3e..695926d8a 100755
--- a/application/common.php
+++ b/application/common.php
@@ -242,10 +242,12 @@ function MyUrl($path, $params=[])
*/
function PluginsHomeUrl($plugins_name, $plugins_control, $plugins_action, $params=[])
{
- $params['pluginsname'] = $plugins_name;
- $params['pluginscontrol'] = $plugins_control;
- $params['pluginsaction'] = $plugins_action;
- $url = url('index/plugins/index', $params, true, true);
+ $plugins = [
+ 'pluginsname' => $plugins_name,
+ 'pluginscontrol' => $plugins_control,
+ 'pluginsaction' => $plugins_action,
+ ];
+ $url = url('index/plugins/index', $plugins+$params, true, true);
// 是否根目录访问项目
if(defined('IS_ROOT_ACCESS'))
@@ -270,10 +272,12 @@ function PluginsHomeUrl($plugins_name, $plugins_control, $plugins_action, $param
*/
function PluginsAdminUrl($plugins_name, $plugins_control, $plugins_action, $params=[])
{
- $params['pluginsname'] = $plugins_name;
- $params['pluginscontrol'] = $plugins_control;
- $params['pluginsaction'] = $plugins_action;
- $url = url('admin/plugins/index', $params, true, true);
+ $plugins = [
+ 'pluginsname' => $plugins_name,
+ 'pluginscontrol' => $plugins_control,
+ 'pluginsaction' => $plugins_action,
+ ];
+ $url = url('admin/plugins/index', $plugins+$params, true, true);
// 是否根目录访问项目
if(defined('IS_ROOT_ACCESS'))
diff --git a/application/index/controller/Answer.php b/application/index/controller/Answer.php
new file mode 100755
index 000000000..e7d7ef248
--- /dev/null
+++ b/application/index/controller/Answer.php
@@ -0,0 +1,95 @@
+IsLogin();
+ }
+
+ /**
+ * 问答/留言列表
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-28
+ * @desc description
+ */
+ public function Index()
+ {
+ // 参数
+ $params = input();
+ $params['user'] = $this->user;
+
+ // 分页
+ $number = 10;
+
+ // 条件
+ $where = AnswerService::AnswerListWhere($params);
+
+ // 获取总数
+ $total = AnswerService::AnswerTotal($where);
+
+ // 分页
+ $page_params = array(
+ 'number' => $number,
+ 'total' => $total,
+ 'where' => $params,
+ 'page' => isset($params['page']) ? intval($params['page']) : 1,
+ 'url' => MyUrl('admin/answer/index'),
+ );
+ $page = new \base\Page($page_params);
+ $this->assign('page_html', $page->GetPageHtml());
+
+ // 获取列表
+ $data_params = array(
+ 'm' => $page->GetPageStarNumber(),
+ 'n' => $number,
+ 'where' => $where,
+ );
+ $data = AnswerService::AnswerList($data_params);
+ $this->assign('data_list', $data['data']);
+
+ // 状态
+ $this->assign('common_is_show_list', lang('common_is_show_list'));
+
+ // 是否
+ $this->assign('common_is_text_list', lang('common_is_text_list'));
+
+ // 参数
+ $this->assign('params', $params);
+ return $this->fetch();
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/application/index/lang/zh-cn.php b/application/index/lang/zh-cn.php
index dd95bc78c..4a217880d 100755
--- a/application/index/lang/zh-cn.php
+++ b/application/index/lang/zh-cn.php
@@ -94,6 +94,13 @@ return array(
'is_show' => 1,
'icon' => 'am-icon-lastfm',
),
+ array(
+ 'control' => 'answer',
+ 'action' => 'index',
+ 'name' => '问答/留言',
+ 'is_show' => 1,
+ 'icon' => 'am-icon-question',
+ ),
array(
'control' => 'user',
'action' => 'logout',
diff --git a/application/index/view/default/answer/index.html b/application/index/view/default/answer/index.html
new file mode 100755
index 000000000..c46df43a5
--- /dev/null
+++ b/application/index/view/default/answer/index.html
@@ -0,0 +1,129 @@
+{{include file="public/header" /}}
+
+
+{{include file="public/header_top_nav" /}}
+
+
+{{include file="public/nav_search" /}}
+
+
+{{include file="public/header_nav" /}}
+
+
+{{include file="public/goods_category" /}}
+
+
+
+
+
+ {{include file="public/user_menu" /}}
+
+
+
+
+
+
+
+
+
+
+
+
+ | 姓名 |
+ 电话 |
+ 内容 |
+ 回复 |
+ 是否显示 |
+ 时间 |
+
+
+
+ {{if !empty($data_list)}}
+ {{foreach $data_list as $v}}
+
+ | {{$v.name}} |
+ {{$v.tel}} |
+ {{$v.content}} |
+
+ {{if $v['is_reply'] eq 1}}
+ {{$v.reply}}
+ {{else /}}
+ 未回复
+ {{/if}}
+ |
+ {{$v.is_show_text}} |
+ {{$v.add_time}} |
+
+ {{/foreach}}
+ {{/if}}
+ {{if empty($data_list)}}
+
+ |
+ 没有相关数据
+ |
+
+ {{/if}}
+
+
+
+
+
+ {{if !empty($data_list)}}
+ {{$page_html|raw}}
+ {{/if}}
+
+
+
+
+
+
+{{include file="public/footer" /}}
+
\ No newline at end of file
diff --git a/application/index/view/default/message/index.html b/application/index/view/default/message/index.html
index 21c424fcb..cfbce7f25 100755
--- a/application/index/view/default/message/index.html
+++ b/application/index/view/default/message/index.html
@@ -83,7 +83,7 @@
-
+
diff --git a/application/index/view/default/userintegral/index.html b/application/index/view/default/userintegral/index.html
index 0f54124a7..45eac4992 100755
--- a/application/index/view/default/userintegral/index.html
+++ b/application/index/view/default/userintegral/index.html
@@ -59,7 +59,7 @@
-
+
diff --git a/application/plugins/answers/Hook.php b/application/plugins/answers/Hook.php
index 502854699..2fa9566ca 100644
--- a/application/plugins/answers/Hook.php
+++ b/application/plugins/answers/Hook.php
@@ -1,4 +1,13 @@
fetch('../../../plugins/view/answers/index/index');
}
+ /**
+ * 详情入口
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2019-03-07
+ * @desc description
+ * @param [array] $params [输入参数]
+ */
+ public function detail($params = [])
+ {
+ // 基础数据
+ $base = PluginsService::PluginsData('answers', ['images']);
+ $this->assign('plugins_answers_data', isset($base['data']) ? $base['data'] : []);
+
+ // 商品数据
+ $goods = Service::GoodsList();
+ $this->assign('plugins_answers_goods_list', $goods['data']['goods']);
+
+ // 推荐问答
+ if(!empty($base['data']['category_ids']))
+ {
+ $answers = Service::AnswerList(['n'=>100, 'category_ids'=> $base['data']['category_ids']]);
+ $this->assign('plugins_answers_rc_list', $answers['data']);
+ } else {
+ $this->assign('plugins_answers_rc_list', []);
+ }
+
+ // 获取问答数据
+ $detail = Service::AnswerRow($params);
+ $this->assign('plugins_answers_detail', $detail);
+
+ return $this->fetch('../../../plugins/view/answers/index/detail');
+ }
+
/**
* 提问
* @author Devil
diff --git a/application/plugins/answers/Service.php b/application/plugins/answers/Service.php
index 4d056a3e6..c5a3c63e3 100644
--- a/application/plugins/answers/Service.php
+++ b/application/plugins/answers/Service.php
@@ -349,5 +349,45 @@ class Service
);
return AnswerService::AnswerList($data_params);
}
+
+ /**
+ * 获取一条问答
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2016-12-06T21:31:53+0800
+ * @param [array] $params [输入参数]
+ */
+ public static function AnswerRow($params = [])
+ {
+ // 参数
+ if(empty($params['id']))
+ {
+ return DataReturn('问答id有误', -1);
+ }
+ // 条件
+ $where = [
+ ['is_delete_time', '=', 0],
+ ['is_show', '=', 1],
+ ['id', '=', intval($params['id'])],
+ ];
+
+ // 字段
+ $field = 'content,reply,is_reply,add_time';
+
+ // 获取列表
+ $data_params = array(
+ 'm' => 0,
+ 'n' => 1,
+ 'where' => $where,
+ 'field' => $field,
+ );
+ $ret = AnswerService::AnswerList($data_params);
+ if(isset($ret['data'][0]))
+ {
+ $ret['data'] = $ret['data'][0];
+ }
+ return $ret;
+ }
}
?>
\ No newline at end of file
diff --git a/application/plugins/view/answers/index/detail.html b/application/plugins/view/answers/index/detail.html
new file mode 100644
index 000000000..00b31b773
--- /dev/null
+++ b/application/plugins/view/answers/index/detail.html
@@ -0,0 +1,111 @@
+{{include file="public/header" /}}
+
+
+{{include file="public/header_top_nav" /}}
+
+
+{{include file="public/nav_search" /}}
+
+
+{{include file="public/header_nav" /}}
+
+
+{{include file="public/goods_category" /}}
+
+
+
+
+
+ {{if isset($plugins_answers_detail['code']) and $plugins_answers_detail['code'] eq 0}}
+ {{if !empty($plugins_answers_detail['data']['content'])}}
+
+
{{$plugins_answers_detail.data.content}}
+
{{$plugins_answers_detail.data.add_time_date}}
+
+
+
+ {{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}}
+ 已回答
+ {{$plugins_answers_detail.data.reply}}
+ {{else /}}
+ 待回答
+ {{/if}}
+
+
+ {{else /}}
+
没有相关数据
+ {{/if}}
+ {{else /}}
+
{{$plugins_answers_detail.msg}}
+ {{/if}}
+
+
+
+
+
+
+ {{include file="../../../plugins/view/answers/index/popup" /}}
+
+
+
+
+{{include file="public/footer" /}}
+
\ No newline at end of file
diff --git a/application/plugins/view/answers/index/index.html b/application/plugins/view/answers/index/index.html
index 2aef80042..0ea11c573 100644
--- a/application/plugins/view/answers/index/index.html
+++ b/application/plugins/view/answers/index/index.html
@@ -22,14 +22,14 @@
@@ -41,12 +41,12 @@