You've already forked think-plugs-notice
54 lines
912 B
PHP
54 lines
912 B
PHP
<?php
|
|
|
|
|
|
use jerryyan\notice\Service;
|
|
use think\admin\extend\PhinxExtend;
|
|
use think\migration\Migrator;
|
|
|
|
@set_time_limit(0);
|
|
@ini_set('memory_limit', -1);
|
|
|
|
/**
|
|
* 系统模块数据
|
|
*/
|
|
class InstallNoticeMenu extends Migrator
|
|
{
|
|
|
|
/**
|
|
* 获取脚本名称
|
|
* @return string
|
|
*/
|
|
public function getName(): string
|
|
{
|
|
return 'NoticePlugin';
|
|
}
|
|
|
|
|
|
/**
|
|
* 创建数据库
|
|
*/
|
|
public function change()
|
|
{
|
|
$this->insertMenu();
|
|
}
|
|
|
|
/**
|
|
* 初始化系统菜单
|
|
* @return void
|
|
* @throws \Exception
|
|
*/
|
|
private function insertMenu()
|
|
{
|
|
|
|
// 初始化菜单数据
|
|
PhinxExtend::write2menu([
|
|
[
|
|
'name' => '消息通知',
|
|
'sort' => '105',
|
|
'subs' => Service::menu(),
|
|
],
|
|
], [
|
|
'url|node' => 'notice/notice/index'
|
|
]);
|
|
}
|
|
} |