From a719129b64a99a334dbbdfe214186d1c7166ffdc Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Tue, 21 Jan 2020 17:43:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=A4=87?= =?UTF-8?q?=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catch/system/controller/DataDictionary.php | 2 +- extend/catcher/command/BackupCommand.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/catch/system/controller/DataDictionary.php b/catch/system/controller/DataDictionary.php index 50243db..1246c35 100644 --- a/catch/system/controller/DataDictionary.php +++ b/catch/system/controller/DataDictionary.php @@ -96,7 +96,7 @@ class DataDictionary extends CatchController public function backup(): \think\response\Json { try { - Console::call('backup:data', [trim(implode(',', \request()->post('data')), ',')]); + Console::call('backup:data', [trim(implode(',', \request()->post('data')), ','), '-z']); }catch (\Exception $e) { throw new FailedException($e->getMessage()); } diff --git a/extend/catcher/command/BackupCommand.php b/extend/catcher/command/BackupCommand.php index c6a6d19..2beeabf 100644 --- a/extend/catcher/command/BackupCommand.php +++ b/extend/catcher/command/BackupCommand.php @@ -21,7 +21,7 @@ class BackupCommand extends Command // 指令配置 $this->setName('backup:data') ->addArgument('tables', Argument::REQUIRED, 'backup tables') - ->addOption('zip', 'z',Option::VALUE_REQUIRED, 'is need zip') + ->addOption('zip', '-z',Option::VALUE_NONE, 'is need zip') ->setDescription('backup data you need'); } @@ -29,7 +29,7 @@ class BackupCommand extends Command { $tables = $this->input->getArgument('tables'); - $isZip = $this->input->getOption('zip') ?? true; + $isZip = $this->input->getOption('zip'); $this->generator(explode(',', $tables), CatchAdmin::backupDirectory());