123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <?php
- namespace addons\wechat;
- use app\common\library\Menu;
- use think\Addons;
- /**
- * 微信插件
- */
- class Wechat extends Addons
- {
- /**
- * 插件安装方法
- * @return bool
- */
- public function install()
- {
- $menu = [
- [
- 'name' => 'wechat',
- 'title' => '微信管理',
- 'icon' => 'fa fa-wechat',
- 'sublist' => [
- [
- 'name' => 'wechat/autoreply',
- 'title' => '自动回复管理',
- 'icon' => 'fa fa-reply-all',
- 'sublist' => [
- ['name' => 'wechat/autoreply/index', 'title' => '查看'],
- ['name' => 'wechat/autoreply/add', 'title' => '添加'],
- ['name' => 'wechat/autoreply/edit', 'title' => '修改'],
- ['name' => 'wechat/autoreply/del', 'title' => '删除'],
- ['name' => 'wechat/autoreply/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'wechat/config',
- 'title' => '配置管理',
- 'icon' => 'fa fa-cog',
- 'sublist' => [
- ['name' => 'wechat/config/index', 'title' => '查看'],
- ['name' => 'wechat/config/add', 'title' => '添加'],
- ['name' => 'wechat/config/edit', 'title' => '修改'],
- ['name' => 'wechat/config/del', 'title' => '删除'],
- ['name' => 'wechat/config/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'wechat/menu',
- 'title' => '菜单管理',
- 'icon' => 'fa fa-list',
- 'sublist' => [
- ['name' => 'wechat/menu/index', 'title' => '查看'],
- ['name' => 'wechat/menu/add', 'title' => '添加'],
- ['name' => 'wechat/menu/edit', 'title' => '修改'],
- ['name' => 'wechat/menu/del', 'title' => '删除'],
- ['name' => 'wechat/menu/remote', 'title' => '加载远程菜单'],
- ['name' => 'wechat/menu/sync', 'title' => '同步'],
- ['name' => 'wechat/menu/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'wechat/response',
- 'title' => '资源管理',
- 'icon' => 'fa fa-list-alt',
- 'sublist' => [
- ['name' => 'wechat/response/index', 'title' => '查看'],
- ['name' => 'wechat/response/add', 'title' => '添加'],
- ['name' => 'wechat/response/edit', 'title' => '修改'],
- ['name' => 'wechat/response/del', 'title' => '删除'],
- ['name' => 'wechat/response/select', 'title' => '选择'],
- ['name' => 'wechat/response/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'wechat/plan',
- 'title' => '微信模版列表管理',
- 'icon' => 'fa fa-list',
- 'sublist' => [
- ['name' => 'wechat/plan/index', 'title' => '查看'],
- ['name' => 'wechat/plan/add', 'title' => '添加'],
- ['name' => 'wechat/plan/edit', 'title' => '修改'],
- ['name' => 'wechat/plan/del', 'title' => '删除'],
- ['name' => 'wechat/plan/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'wechat/planRecord',
- 'title' => '微信签约记录',
- 'icon' => 'fa fa-list',
- 'sublist' => [
- ['name' => 'wechat/plan_record/index', 'title' => '查看'],
- ['name' => 'wechat/plan_record/add', 'title' => '添加'],
- ['name' => 'wechat/plan_record/edit', 'title' => '修改'],
- ['name' => 'wechat/plan_record/del', 'title' => '删除'],
- ['name' => 'wechat/plan_record/multi', 'title' => '批量更新'],
- ]
- ]
- ]
- ]
- ];
- Menu::create($menu);
- return true;
- }
- /**
- * 插件卸载方法
- * @return bool
- */
- public function uninstall()
- {
- Menu::delete('wechat');
- return true;
- }
- /**
- * 插件启用方法
- */
- public function enable()
- {
- Menu::enable('wechat');
- }
- /**
- * 插件禁用方法
- */
- public function disable()
- {
- Menu::disable('wechat');
- }
- }
|