修改数据备份

This commit is contained in:
wuyanwen 2020-01-21 17:43:09 +08:00
parent dfd0be23c6
commit a719129b64
2 changed files with 3 additions and 3 deletions

View File

@ -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());
}

View File

@ -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());