catch-seed:run
This commit is contained in:
@@ -5,6 +5,7 @@ use catcher\command\InstallCommand;
|
||||
use catcher\command\MigrateRunCommand;
|
||||
use catcher\command\ModelGeneratorCommand;
|
||||
use catcher\command\ModuleCacheCommand;
|
||||
use catcher\command\SeedRunCommand;
|
||||
use catcher\validates\Sometimes;
|
||||
use think\facade\Validate;
|
||||
use think\Service;
|
||||
@@ -23,6 +24,7 @@ class CatchAdminService extends Service
|
||||
ModuleCacheCommand::class,
|
||||
MigrateRunCommand::class,
|
||||
ModelGeneratorCommand::class,
|
||||
SeedRunCommand::class
|
||||
]);
|
||||
|
||||
$this->registerValidates();
|
||||
|
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class Abc 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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
30
catchAdmin/user/database/seeds/UserSeeder.php
Normal file
30
catchAdmin/user/database/seeds/UserSeeder.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class UserSeeder 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()
|
||||
{
|
||||
$row = [
|
||||
'username' => 'wuyanwen',
|
||||
'password' => password_hash('password',PASSWORD_DEFAULT),
|
||||
'email' => 'njphper@gmail.com',
|
||||
'status' => 1,
|
||||
'last_login_ip' => ip2long('127.0.0.1'),
|
||||
'last_login_time' => time(),
|
||||
'created_at' => time(),
|
||||
'updated_at' => time(),
|
||||
'deleted_at' => '',
|
||||
];
|
||||
$this->table('users')->insert($row)->save();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user