89 lines
3.2 KiB
PHP
89 lines
3.2 KiB
PHP
<?php
|
|
|
|
use think\migration\Seeder;
|
|
|
|
class AdminAdd 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()
|
|
{
|
|
$data = [
|
|
[
|
|
'id' => null,
|
|
'mobile' => '15207335533',
|
|
'code' => 'YC001',
|
|
'platform_id'=> 0,
|
|
'role_id' => 1,
|
|
'org_id' => 1,
|
|
'dept_group_id'=> 1,
|
|
'dept_id' => 1,
|
|
'avatar' => 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
|
|
'nickname' => 'admin',
|
|
'username' => 'admin',
|
|
'password' => 'a20dddcf28da48f605ac8412384b3e36',
|
|
'create_ip' => '127.0.0.1',
|
|
'create_time'=> time(),
|
|
'update_time'=> time(),
|
|
],[
|
|
'id' => null,
|
|
'mobile' => '15207335533',
|
|
'code' => 'YC002',
|
|
'platform_id'=> 1,
|
|
'role_id' => 1,
|
|
'org_id' => 1,
|
|
'dept_group_id'=> 1,
|
|
'dept_id' => 1,
|
|
'avatar' => 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
|
|
'nickname' => 'yottamaster',
|
|
'username' => 'yottamaster',
|
|
'password' => 'a20dddcf28da48f605ac8412384b3e36',
|
|
'create_ip' => '127.0.0.1',
|
|
'create_time'=> time(),
|
|
'update_time'=> time(),
|
|
],[
|
|
'id' => null,
|
|
'mobile' => '15207335533',
|
|
'code' => 'YC003',
|
|
'platform_id'=> 2,
|
|
'role_id' => 1,
|
|
'org_id' => 1,
|
|
'dept_group_id'=> 1,
|
|
'dept_id' => 1,
|
|
'avatar' => 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
|
|
'nickname' => 'idsonix',
|
|
'username' => 'idsonix',
|
|
'password' => 'a20dddcf28da48f605ac8412384b3e36',
|
|
'create_ip' => '127.0.0.1',
|
|
'create_time'=> time(),
|
|
'update_time'=> time(),
|
|
],[
|
|
'id' => null,
|
|
'mobile' => '15207335533',
|
|
'code' => 'YC004',
|
|
'platform_id'=> 3,
|
|
'role_id' => 1,
|
|
'org_id' => 1,
|
|
'dept_group_id'=> 1,
|
|
'dept_id' => 1,
|
|
'avatar' => 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
|
|
'nickname' => 'ntonpower',
|
|
'username' => 'ntonpower',
|
|
'password' => 'a20dddcf28da48f605ac8412384b3e36',
|
|
'create_ip' => '127.0.0.1',
|
|
'create_time'=> time(),
|
|
'update_time'=> time(),
|
|
],
|
|
|
|
];
|
|
|
|
$table = $this->table('admin');
|
|
$table->insert($data)->saveData();
|
|
}
|
|
} |