mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 10:02:49 +08:00
feat: 发布智能体版
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace base\common\command\tools\db;
|
||||
|
||||
use base\common\service\ToolsDbServiceBase;
|
||||
use think\console\Command;
|
||||
use app\common\service\tools\DbService;
|
||||
use app\common\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\input\Option;
|
||||
use think\console\Output;
|
||||
@@ -13,6 +13,8 @@ class ToolsDbTableBase extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
parent::configure();
|
||||
|
||||
$this->setName('tools:db:table')
|
||||
->setDescription('使用查询构建器操作表')
|
||||
->addArgument('table', null, '表名')
|
||||
@@ -28,12 +30,12 @@ class ToolsDbTableBase extends Command
|
||||
protected function execute($input, $output)
|
||||
{
|
||||
if ($input->getOption('help')) {
|
||||
$service = new ToolsDbServiceBase();
|
||||
$service = new DbService();
|
||||
$service->showHelp('tools:db:table', $output);
|
||||
return;
|
||||
}
|
||||
|
||||
$service = new ToolsDbServiceBase();
|
||||
$service = new DbService();
|
||||
|
||||
if (!$service->checkDebugMode($output)) {
|
||||
return;
|
||||
@@ -75,10 +77,11 @@ class ToolsDbTableBase extends Command
|
||||
|
||||
if ($count) {
|
||||
$result = $query->count();
|
||||
$output->writeln('');
|
||||
$output->writeln('<info>表名:' . $fullTableName . '</info>');
|
||||
|
||||
$output->newLine();
|
||||
$output->info('表名:' . $fullTableName);
|
||||
$output->writeln('记录数:' . $result);
|
||||
$output->writeln('');
|
||||
$output->newLine();
|
||||
} else {
|
||||
if ($limit && is_numeric($limit)) {
|
||||
$query->limit((int)$limit);
|
||||
@@ -89,17 +92,17 @@ class ToolsDbTableBase extends Command
|
||||
$endTime = microtime(true);
|
||||
$executionTime = round(($endTime - $startTime) * 1000, 2);
|
||||
|
||||
$output->writeln('');
|
||||
$output->writeln('<info>表名:' . $fullTableName . '</info>');
|
||||
$output->newLine();
|
||||
$output->info('表名:' . $fullTableName);
|
||||
$service->formatTableOutput($result, $output);
|
||||
$output->writeln('');
|
||||
$output->newLine();
|
||||
$output->writeln('影响行数:' . count($result));
|
||||
$output->writeln('执行时间:' . $executionTime . 'ms');
|
||||
$output->writeln('');
|
||||
$output->newLine();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$output->error('查询失败:' . $e->getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user