mirror of
https://gitee.com/ctexthuang/hyperf-micro-svc.git
synced 2026-02-08 10:20:16 +08:00
126 lines
4.5 KiB
PHP
126 lines
4.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Hyperf\Database\Seeders\Seeder;
|
|
|
|
class AdminMenuUpdate01 extends Seeder
|
|
{
|
|
public const array BASE_DATA = [
|
|
'name' => '',
|
|
'path' => '',
|
|
'component' => '',
|
|
'redirect' => '',
|
|
'created_by' => 0,
|
|
'updated_by' => 0,
|
|
'remark' => '',
|
|
];
|
|
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run(): void
|
|
{
|
|
// AdminMenu::truncate();
|
|
// if (env('DB_DRIVER') === 'odbc-sql-server') {
|
|
// Db::unprepared('SET IDENTITY_INSERT [' . AdminMenu::getModel()->getTable() . '] ON;');
|
|
// }
|
|
// $this->create($this->data());
|
|
// if (env('DB_DRIVER') === 'odbc-sql-server') {
|
|
// Db::unprepared('SET IDENTITY_INSERT [' . AdminMenu::getModel()->getTable() . '] OFF;');
|
|
// }
|
|
}
|
|
|
|
//
|
|
// /**
|
|
// * @param array $data
|
|
// * @param int $parentId
|
|
// * @return void
|
|
// */
|
|
// private function create(array $data, int $parentId = 0): void
|
|
// {
|
|
// foreach ($data as $item) {
|
|
// $_item = $item;
|
|
//
|
|
// if (isset($v['children'])) unset($_item['children']);
|
|
//
|
|
// $_item['parent_id'] = $parentId;
|
|
//
|
|
// $insert = AdminMenu::create(array_merge(self::BASE_DATA, $_item));
|
|
//
|
|
// if (isset($item['children']) && count($item['children'])) $this->create($item['children'], $insert->id);
|
|
// }
|
|
// }
|
|
//
|
|
// private function data(): array
|
|
// {
|
|
// return [
|
|
// [
|
|
// 'name' => 'dataCenter',
|
|
// 'path' => '/dataCenter',
|
|
// 'meta' => new AdminUserMeta([
|
|
// 'title' => '数据中心',
|
|
// 'i18n' => 'baseMenu.dataCenter.index',
|
|
// 'icon' => 'ri:database-line',
|
|
// 'type' => 'M',
|
|
// 'hidden' => 0,
|
|
// 'componentPath' => 'modules/',
|
|
// 'componentSuffix' => '.vue',
|
|
// 'breadcrumbEnable' => 1,
|
|
// 'copyright' => 1,
|
|
// 'cache' => 1,
|
|
// 'affix' => 0,
|
|
// ]),
|
|
// 'children' => [
|
|
// [
|
|
// 'name' => 'dataCenter:attachment',
|
|
// 'path' => '/dataCenter/attachment',
|
|
// 'component' => 'base/views/dataCenter/attachment/index',
|
|
// 'meta' => new AdminUserMeta([
|
|
// 'title' => '附件管理',
|
|
// 'type' => 'M',
|
|
// 'hidden' => 0,
|
|
// 'icon' => 'ri:attachment-line',
|
|
// 'i18n' => 'baseMenu.dataCenter.attachment',
|
|
// 'componentPath' => 'modules/',
|
|
// 'componentSuffix' => '.vue',
|
|
// 'breadcrumbEnable' => 1,
|
|
// 'copyright' => 1,
|
|
// 'cache' => 1,
|
|
// 'affix' => 0,
|
|
// ]),
|
|
// 'children' => [
|
|
// [
|
|
// 'name' => 'dataCenter:attachment:list',
|
|
// 'meta' => new Meta([
|
|
// 'title' => '附件列表',
|
|
// 'i18n' => 'baseMenu.dataCenter.attachmentList',
|
|
// 'type' => 'B',
|
|
// ]),
|
|
// ],
|
|
// [
|
|
// 'name' => 'dataCenter:attachment:upload',
|
|
// 'meta' => new Meta([
|
|
// 'title' => '上传附件',
|
|
// 'i18n' => 'baseMenu.dataCenter.attachmentUpload',
|
|
// 'type' => 'B',
|
|
// ]),
|
|
// ],
|
|
// [
|
|
// 'name' => 'dataCenter:attachment:delete',
|
|
// 'meta' => new Meta([
|
|
// 'title' => '删除附件',
|
|
// 'i18n' => 'baseMenu.dataCenter.attachmentDelete',
|
|
// 'type' => 'B',
|
|
// ]),
|
|
// ],
|
|
// ],
|
|
// ],
|
|
// ],
|
|
// ],
|
|
// ];
|
|
// }
|
|
}
|