Files
mayi-grade/database/seeds/Admin.php
T

28 lines
650 B
PHP

<?php
use think\migration\Seeder;
class Admin extends Seeder
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run()
{
// 初始化超级管理员
$rows[] = [
'id' => 1,
'xingming' => '超级管理员',
'username' => 'admin',
'password' => '$apr1$RSUodBwI$zOhVq9RQWfQDOW2sbeCDS1',
];
// 保存数据
$this->table('admin')->insert($rows)->save();
}
}