修改数据备份
This commit is contained in:
parent
dfd0be23c6
commit
a719129b64
@ -96,7 +96,7 @@ class DataDictionary extends CatchController
|
|||||||
public function backup(): \think\response\Json
|
public function backup(): \think\response\Json
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Console::call('backup:data', [trim(implode(',', \request()->post('data')), ',')]);
|
Console::call('backup:data', [trim(implode(',', \request()->post('data')), ','), '-z']);
|
||||||
}catch (\Exception $e) {
|
}catch (\Exception $e) {
|
||||||
throw new FailedException($e->getMessage());
|
throw new FailedException($e->getMessage());
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class BackupCommand extends Command
|
|||||||
// 指令配置
|
// 指令配置
|
||||||
$this->setName('backup:data')
|
$this->setName('backup:data')
|
||||||
->addArgument('tables', Argument::REQUIRED, 'backup tables')
|
->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');
|
->setDescription('backup data you need');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ class BackupCommand extends Command
|
|||||||
{
|
{
|
||||||
$tables = $this->input->getArgument('tables');
|
$tables = $this->input->getArgument('tables');
|
||||||
|
|
||||||
$isZip = $this->input->getOption('zip') ?? true;
|
$isZip = $this->input->getOption('zip');
|
||||||
|
|
||||||
$this->generator(explode(',', $tables), CatchAdmin::backupDirectory());
|
$this->generator(explode(',', $tables), CatchAdmin::backupDirectory());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user