From e7fa3c58fc445203168d2fc0ed38b3e55e676d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Fri, 21 Apr 2017 10:09:07 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=A2=9E=E5=8A=A0]=E5=BE=AE=E4=BF=A1=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=AD=97=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Index.php | 2 +- application/admin/view/menu.form.html | 2 +- application/wechat/controller/Keys.php | 38 ++- application/wechat/controller/Review.php | 24 ++ application/wechat/view/keys.form.html | 300 +++++++++++++++++++++++ application/wechat/view/keys.index.html | 174 +++++++++++++ 6 files changed, 537 insertions(+), 3 deletions(-) create mode 100644 application/wechat/controller/Review.php create mode 100644 application/wechat/view/keys.form.html create mode 100644 application/wechat/view/keys.index.html diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index e3e4907a6..291785ee4 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -38,7 +38,7 @@ class Index extends BasicAdmin { NodeModel::applyAuthNode(); $list = Db::name('SystemMenu')->where('status', '1')->order('sort asc,id asc')->select(); $menus = $this->_filterMenu(ToolsService::arr2tree($list)); - $this->assign('title', '平台管理'); + $this->assign('title', '系统管理'); $this->assign('menus', $menus); return view(); } diff --git a/application/admin/view/menu.form.html b/application/admin/view/menu.form.html index 7a50871f3..741404be8 100644 --- a/application/admin/view/menu.form.html +++ b/application/admin/view/menu.form.html @@ -1,4 +1,4 @@ -
+
diff --git a/application/wechat/controller/Keys.php b/application/wechat/controller/Keys.php index 5470e0048..9c899f8a1 100644 --- a/application/wechat/controller/Keys.php +++ b/application/wechat/controller/Keys.php @@ -14,6 +14,7 @@ namespace app\wechat\controller; use controller\BasicAdmin; +use think\Db; /** * 微信文章管理 @@ -24,8 +25,43 @@ use controller\BasicAdmin; */ class Keys extends BasicAdmin { - public function index() { + protected $table = 'WechatKeys'; + /** + * 显示关键字列表 + */ + public function index() { + $this->assign('title', '微信关键字'); + $db = Db::name($this->table)->where('keys', 'not in', ['subscribe', 'default']); + $this->_list($db); + } + + /** + * 列表数据处理 + * @param array $data + */ + protected function _index_data_filter(&$data) { + $types = ['keys' => '关键字', 'image' => '图片', 'news' => '图文', 'music' => '音乐', 'text' => '文字', 'video' => '视频', 'voice' => '语音']; + foreach ($data as &$vo) { + $vo['type'] = isset($types[$vo['type']]) ? $types[$vo['type']] : $vo['type']; + } + } + + /** + * 添加关键字 + * @return string + */ + public function add() { + $this->assign('title', '添加关键字规则'); + return $this->_form($this->table, 'form', 'id'); + } + + /** + * 编辑关键字 + * @return string + */ + public function edit() { + return $this->_form($this->table, 'form', 'id'); } public function subscribe() { diff --git a/application/wechat/controller/Review.php b/application/wechat/controller/Review.php new file mode 100644 index 000000000..6ff00975d --- /dev/null +++ b/application/wechat/controller/Review.php @@ -0,0 +1,24 @@ + + +
+
+ +
+ +
+
+
+ +
+ +
+ + {if isset($vo.keys) and $vo.keys neq 'default' and $vo.keys neq 'subscribe'} +
+ +
+ {if isset($vo.keys) and $vo.keys neq ""} + + {else/} + + {/if} +
+
+ {else} +
+ +
+
+ {if !isset($vo.status) or $vo.status neq 0} + + + {else/} + + + {/if} +
+
+
+ {/if} + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ + +
+ +
+ +
+ + + 上传图片 +
+
+ +
+ +
+
+ + + + +
+
+
+ +
+ +
+ +
+
+
+ +
+
+ + + + +
+
+
+
+ +
+ +
+
+
+ +
+ + + + + + 上传图片 + +
+
+ +
+ +
+ +
+
+ +
+ +
+
+ + + + + + + +
+
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+
+
+ {if isset($vo['id'])}{/if} +
+ +
+
+{/block} + +{block name="script"} + +{/block} \ No newline at end of file diff --git a/application/wechat/view/keys.index.html b/application/wechat/view/keys.index.html new file mode 100644 index 000000000..532cf3017 --- /dev/null +++ b/application/wechat/view/keys.index.html @@ -0,0 +1,174 @@ +{extend name='extra@admin/content' /} + +{block name="button"} +
+ +
+{/block} + +{block name='content'} +
+ + + + + + + + + + + + + {foreach $list as $key=>$vo} + + + + + + + + {/foreach} + +
关键字回复类型回复内容更新时间操作
{$vo.keys}{$vo.type} + {if $vo.type eq '音乐'} + + 预览 + + {elseif $vo.type eq '图文'} + + 预览 + + {elseif $vo.type eq '视频'} + + 预览 + + {else} + {$vo.content} + {/if} + {$vo.create_at} + {if auth("$classuri/edit")} + | + 编辑 + {/if} + {if auth("$classuri/del")} + | + 删除 + {/if} +
+ {if isset($page)}

{$page}

{/if} +
+ +{/block} + +{block name="script"} + +{/block} \ No newline at end of file