mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 19:12:48 +08:00
新增临时生成模式;
This commit is contained in:
@@ -244,6 +244,13 @@ class BuildCurdService
|
|||||||
return $this->tableColumns;
|
return $this->tableColumns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setRootDir($dir)
|
||||||
|
{
|
||||||
|
$this->rootDir = $dir;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置主表
|
* 设置主表
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ namespace app\common\command;
|
|||||||
|
|
||||||
|
|
||||||
use app\admin\service\curd\BuildCurdService;
|
use app\admin\service\curd\BuildCurdService;
|
||||||
|
use app\common\tools\PathTools;
|
||||||
use think\console\Command;
|
use think\console\Command;
|
||||||
use think\console\Input;
|
use think\console\Input;
|
||||||
use think\console\input\Option;
|
use think\console\input\Option;
|
||||||
use think\console\Output;
|
use think\console\Output;
|
||||||
use think\Exception;
|
use think\Exception;
|
||||||
|
use think\facade\App;
|
||||||
|
|
||||||
class Curd extends Command
|
class Curd extends Command
|
||||||
{
|
{
|
||||||
@@ -22,6 +24,7 @@ class Curd extends Command
|
|||||||
#
|
#
|
||||||
->addOption('force', 'f', Option::VALUE_NONE, '强制覆盖模式')
|
->addOption('force', 'f', Option::VALUE_NONE, '强制覆盖模式')
|
||||||
->addOption('delete', 'd', Option::VALUE_NONE, '删除模式')
|
->addOption('delete', 'd', Option::VALUE_NONE, '删除模式')
|
||||||
|
->addOption('runtime', 'r', Option::VALUE_NONE, '临时生成')
|
||||||
->setDescription('一键curd命令服务');
|
->setDescription('一键curd命令服务');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,6 +56,15 @@ class Curd extends Command
|
|||||||
->setTable($table)
|
->setTable($table)
|
||||||
->setForce($force);
|
->setForce($force);
|
||||||
|
|
||||||
|
if ($input->hasOption('runtime')) {
|
||||||
|
|
||||||
|
$runtime_path = App::getRuntimePath() . 'source/build/' . date('YmdHis') . '/';
|
||||||
|
dump($runtime_path);
|
||||||
|
PathTools::intiDir($runtime_path . 'a.temp');
|
||||||
|
|
||||||
|
$build->setRootDir($runtime_path);
|
||||||
|
}
|
||||||
|
|
||||||
$columns = $build->getTableColumns();
|
$columns = $build->getTableColumns();
|
||||||
|
|
||||||
$relations = [];
|
$relations = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user