diff --git a/catch/system/database/seeds/GenerateSeed.php b/catch/system/database/seeds/GenerateSeed.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/catch/system/database/seeds/GenerateSeed.php @@ -0,0 +1 @@ +insertGetId($value); + + if ($children) { + foreach ($children as &$v) { + $v[$pid] = $id; + $v['level'] = !$value[$pid] ? $id : $value['level'] . '-' .$id; + } + self::importTreeData($children, $table, $primaryKey); + } + } + } } diff --git a/extend/catcher/command/BackupCommand.php b/extend/catcher/command/Tools/BackupCommand.php similarity index 99% rename from extend/catcher/command/BackupCommand.php rename to extend/catcher/command/Tools/BackupCommand.php index 2beeabf..4cc66cf 100644 --- a/extend/catcher/command/BackupCommand.php +++ b/extend/catcher/command/Tools/BackupCommand.php @@ -4,7 +4,6 @@ declare (strict_types = 1); namespace catcher\command; use catcher\CatchAdmin; -use think\Config; use think\console\Command; use think\console\Input; use think\console\input\Argument; diff --git a/extend/catcher/command/CompressPackageCommand.php b/extend/catcher/command/Tools/CompressPackageCommand.php similarity index 100% rename from extend/catcher/command/CompressPackageCommand.php rename to extend/catcher/command/Tools/CompressPackageCommand.php diff --git a/extend/catcher/command/Tools/ExportDataCommand.php b/extend/catcher/command/Tools/ExportDataCommand.php new file mode 100644 index 0000000..e027cf9 --- /dev/null +++ b/extend/catcher/command/Tools/ExportDataCommand.php @@ -0,0 +1,32 @@ +setName('backup:data') + ->addArgument('tables', Argument::REQUIRED, 'backup tables') + ->addOption('zip', '-z',Option::VALUE_NONE, 'is need zip') + ->setDescription('backup data you need'); + } + + protected function execute(Input $input, Output $output) + { + + $output->info('succeed!'); + } +}