ConfigSeed.php 809 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use think\migration\Seeder;
  3. class ConfigSeed extends Seeder
  4. {
  5. /**
  6. * Run Method.
  7. *
  8. * Write your database seeder using this method.
  9. *
  10. * More information on writing seeders is available here:
  11. * http://docs.phinx.org/en/latest/seeding.html
  12. */
  13. public function run()
  14. {
  15. $data = [
  16. [
  17. 'name' => '基础配置',
  18. 'pid' => 0,
  19. 'component' => 'basic',
  20. 'key' => 'basic',
  21. ],
  22. [
  23. 'name' => '上传配置',
  24. 'pid' => 0,
  25. 'component' => 'upload',
  26. 'key' => 'upload',
  27. ],
  28. ];
  29. foreach ($data as $item) {
  30. \catchAdmin\system\model\Config::create($item);
  31. }
  32. }
  33. }