From 6b4dd70752113f4fe99d0f709476155396f0191b Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Tue, 3 Dec 2019 21:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catchAdmin/CatchAdminService.php | 4 ++++ .../migrations/20191128114204_users.php | 10 ++++---- catchAdmin/user/model/Users.php | 23 +++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 catchAdmin/user/model/Users.php diff --git a/catchAdmin/CatchAdminService.php b/catchAdmin/CatchAdminService.php index 6a450eb..606f99f 100644 --- a/catchAdmin/CatchAdminService.php +++ b/catchAdmin/CatchAdminService.php @@ -2,6 +2,8 @@ namespace catchAdmin; use catcher\command\InstallCommand; +use catcher\command\MigrateRunCommand; +use catcher\command\ModelGeneratorCommand; use catcher\command\ModuleCacheCommand; use think\Service; @@ -17,6 +19,8 @@ class CatchAdminService extends Service $this->commands([ InstallCommand::class, ModuleCacheCommand::class, + MigrateRunCommand::class, + ModelGeneratorCommand::class, ]); } } \ No newline at end of file diff --git a/catchAdmin/user/database/migrations/20191128114204_users.php b/catchAdmin/user/database/migrations/20191128114204_users.php index 1a0c044..6d48155 100644 --- a/catchAdmin/user/database/migrations/20191128114204_users.php +++ b/catchAdmin/user/database/migrations/20191128114204_users.php @@ -28,16 +28,16 @@ class Users extends Migrator */ public function change() { - $table = $this->table('users',array('engine'=>'Innodb')); + $table = $this->table('users',array('engine'=>'Innodb', 'comment' => '用户表', 'signed' => false)); $table->addColumn('username', 'string',array('limit' => 15,'default'=>'','comment'=>'用户名')) ->addColumn('password', 'string',array('limit' => 255,'comment'=>'用户密码')) ->addColumn('email', 'string',array('limit' => 100, 'comment'=>'邮箱 登录')) ->addColumn('status', 'boolean',array('limit' => 1,'default'=> 1,'comment'=>'用户状态 1 正常 2 禁用')) ->addColumn('last_login_ip', 'integer',array('limit' => 11,'default'=>0,'comment'=>'最后登录IP')) - ->addColumn('last_login_time', 'integer',array('default'=>0,'comment'=>'最后登录时间', 'unsigned' => true)) - ->addColumn('created_at', 'integer',array('default'=>0,'comment'=>'创建时间', 'unsigned' => true)) - ->addColumn('updated_at', 'integer',array('default'=>0,'comment'=>'更新时间', 'unsigned' => true)) - ->addColumn('delete_at', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'删除状态,0未删除 >0 已删除', 'unsigned' => true)) + ->addColumn('last_login_time', 'integer',array('default'=>0,'comment'=>'最后登录时间', 'signed' => false)) + ->addColumn('created_at', 'integer', array('default'=>0,'comment'=>'创建时间', 'signed' => false )) + ->addColumn('updated_at', 'integer', array('default'=>0,'comment'=>'更新时间', 'signed' => false)) + ->addColumn('delete_at', 'integer', array('null'=>true,'comment'=>'删除状态,0未删除 >0 已删除', 'signed' => false)) ->addIndex(array('email'), array('unique' => true)) ->create(); } diff --git a/catchAdmin/user/model/Users.php b/catchAdmin/user/model/Users.php new file mode 100644 index 0000000..d8dbc97 --- /dev/null +++ b/catchAdmin/user/model/Users.php @@ -0,0 +1,23 @@ +0 已删除 + + ]; +} \ No newline at end of file