DomainMenusSeed.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CatchAdmin [Just Like ~ ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
  8. // +----------------------------------------------------------------------
  9. // | Author: JaguarJack [ njphper@gmail.com ]
  10. // +----------------------------------------------------------------------
  11. use think\migration\Seeder;
  12. class DomainMenusSeed extends Seeder
  13. {
  14. /**
  15. * Run Method.
  16. *
  17. * Write your database seeder using this method.
  18. *
  19. * More information on writing seeders is available here:
  20. * http://docs.phinx.org/en/latest/seeding.html
  21. */
  22. public function run()
  23. {
  24. \catcher\Utils::importTreeData($this->getPermissions(), 'permissions', 'parent_id');
  25. }
  26. protected function getPermissions()
  27. {
  28. return array (
  29. 0 =>
  30. array (
  31. 'id' => 72,
  32. 'permission_name' => '域名管理',
  33. 'parent_id' => 0,
  34. 'level' => '',
  35. 'route' => '/domain',
  36. 'icon' => 'el-icon-stopwatch',
  37. 'module' => 'domain',
  38. 'creator_id' => 1,
  39. 'permission_mark' => 'domain',
  40. 'component' => 'layout',
  41. 'redirect' => '/domain/index',
  42. 'keepalive' => 1,
  43. 'type' => 1,
  44. 'hidden' => 1,
  45. 'sort' => 1,
  46. 'created_at' => 1601105834,
  47. 'updated_at' => 1601105834,
  48. 'deleted_at' => 0,
  49. ),
  50. 1 =>
  51. array (
  52. 'id' => 73,
  53. 'permission_name' => '域名设置',
  54. 'parent_id' => 72,
  55. 'level' => '72',
  56. 'route' => '/domain/index',
  57. 'icon' => 'el-icon-setting',
  58. 'module' => 'domain',
  59. 'creator_id' => 1,
  60. 'permission_mark' => 'domain',
  61. 'component' => 'domain',
  62. 'redirect' => '',
  63. 'keepalive' => 1,
  64. 'type' => 1,
  65. 'hidden' => 1,
  66. 'sort' => 8,
  67. 'created_at' => 1601105879,
  68. 'updated_at' => 1601112604,
  69. 'deleted_at' => 0,
  70. ),
  71. 2 =>
  72. array (
  73. 'id' => 84,
  74. 'permission_name' => '域名记录',
  75. 'parent_id' => 72,
  76. 'level' => '72',
  77. 'route' => '/domain/record/:domain',
  78. 'icon' => 'el-icon-document',
  79. 'module' => 'domain',
  80. 'creator_id' => 1,
  81. 'permission_mark' => 'domainRecord',
  82. 'component' => 'domainRecord',
  83. 'redirect' => '',
  84. 'keepalive' => 1,
  85. 'type' => 1,
  86. 'hidden' => 2,
  87. 'sort' => 1,
  88. 'created_at' => 1601112569,
  89. 'updated_at' => 1601112606,
  90. 'deleted_at' => 0,
  91. ),
  92. );
  93. }
  94. }