ThinkAdmin/plugin/think-plugs-wechat/stc/database/20241011000001_install_wechat20241011.php
2024-10-17 16:53:02 +08:00

67 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | Admin Plugin for ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-admin
// | github 代码仓库https://github.com/zoujingli/think-plugs-admin
// +----------------------------------------------------------------------
use app\wechat\Service;
use think\admin\extend\PhinxExtend;
use think\migration\Migrator;
@set_time_limit(0);
@ini_set('memory_limit', -1);
/**
* 系统模块数据
*/
class InstallWechat20241011 extends Migrator
{
/**
* 获取脚本名称
* @return string
*/
public function getName(): string
{
return 'WechatPlugin';
}
/**
* 创建数据库
* @throws \Exception
*/
public function change()
{
$this->insertMenu();
}
/**
* 初始化系统菜单
* @return void
* @throws \Exception
*/
private function insertMenu()
{
// 初始化菜单数据
PhinxExtend::write2menu([
[
'name' => '微信管理',
'sort' => '200',
'subs' => Service::menu(),
],
], [
'url|node' => 'wechat/fans/index'
]);
}
}