mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
ComposerUpdate
This commit is contained in:
parent
c6b3b6c224
commit
22214e4ac7
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -863,12 +863,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||
"reference": "90c1f5dccfe047e542d10d80534a4da174433527"
|
||||
"reference": "a273990298618e97fb7a03082f7a032ba0ad548c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/90c1f5dccfe047e542d10d80534a4da174433527",
|
||||
"reference": "90c1f5dccfe047e542d10d80534a4da174433527",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a273990298618e97fb7a03082f7a032ba0ad548c",
|
||||
"reference": "a273990298618e97fb7a03082f7a032ba0ad548c",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -885,7 +885,7 @@
|
||||
"ext-mbstring": "*",
|
||||
"topthink/framework": "^6.0"
|
||||
},
|
||||
"time": "2021-02-25T03:15:54+00:00",
|
||||
"time": "2021-03-01T02:53:44+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"think": {
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2021-03-01 10:16:28
|
||||
// This file is automatically generated at:2021-03-01 12:04:40
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'think\\admin\\Library',
|
||||
|
@ -19,6 +19,7 @@ namespace think\admin\command;
|
||||
|
||||
use think\admin\Command;
|
||||
use think\admin\Exception;
|
||||
use think\admin\service\SystemService;
|
||||
use think\console\Input;
|
||||
use think\console\input\Argument;
|
||||
use think\console\Output;
|
||||
@ -59,7 +60,7 @@ class Database extends Command
|
||||
protected function _repair(): void
|
||||
{
|
||||
$this->setQueueProgress("正在获取需要修复的数据表", 0);
|
||||
[$total, $count] = [count($tables = $this->getTables()), 0];
|
||||
[$tables, $total, $count] = SystemService::instance()->getTables();
|
||||
$this->setQueueProgress("总共需要修复 {$total} 张数据表", 0);
|
||||
foreach ($tables as $table) {
|
||||
$this->queue->message($total, ++$count, "正在修复数据表 {$table}");
|
||||
@ -76,7 +77,7 @@ class Database extends Command
|
||||
protected function _optimize(): void
|
||||
{
|
||||
$this->setQueueProgress("正在获取需要优化的数据表", 0);
|
||||
[$total, $count] = [count($tables = $this->getTables()), 0];
|
||||
[$tables, $total, $count] = SystemService::instance()->getTables();
|
||||
$this->setQueueProgress("总共需要优化 {$total} 张数据表", 0);
|
||||
foreach ($tables as $table) {
|
||||
$this->queue->message($total, ++$count, "正在优化数据表 {$table}");
|
||||
@ -86,17 +87,4 @@ class Database extends Command
|
||||
$this->queue->success("已完成对 {$total} 张数据表优化操作");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据库的数据表
|
||||
* @return array
|
||||
*/
|
||||
protected function getTables(): array
|
||||
{
|
||||
$tables = [];
|
||||
foreach ($this->app->db->query("show tables") as $item) {
|
||||
$tables = array_merge($tables, array_values($item));
|
||||
}
|
||||
return $tables;
|
||||
}
|
||||
|
||||
}
|
@ -19,6 +19,7 @@ namespace think\admin\command;
|
||||
|
||||
use Exception;
|
||||
use think\admin\Command;
|
||||
use think\admin\service\SystemService;
|
||||
use think\console\Input;
|
||||
use think\console\input\Argument;
|
||||
use think\console\Output;
|
||||
@ -52,8 +53,7 @@ class Replace extends Command
|
||||
$repalce = $input->getArgument('replace');
|
||||
if ($search === '') $this->queue->error('查找替换字符内容不能为空!');
|
||||
if ($repalce === '') $this->queue->error('目标替换字符内容不能为空!');
|
||||
|
||||
[$total, $count] = [count($tables = $this->getTables()), 0];
|
||||
[$tables, $total, $count] = SystemService::instance()->getTables();
|
||||
foreach ($tables as $table) {
|
||||
$data = [];
|
||||
$this->queue->message($total, ++$count, sprintf("准备替换数据表 %s", Str::studly($table)));
|
||||
@ -74,17 +74,4 @@ class Replace extends Command
|
||||
}
|
||||
$this->queue->success('批量替换成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据库的数据表
|
||||
* @return array
|
||||
*/
|
||||
protected function getTables(): array
|
||||
{
|
||||
$tables = [];
|
||||
foreach ($this->app->db->query("show tables") as $item) {
|
||||
$tables = array_merge($tables, array_values($item));
|
||||
}
|
||||
return $tables;
|
||||
}
|
||||
}
|
@ -164,6 +164,19 @@ class SystemService extends Service
|
||||
return $this->save('SystemData', ['name' => $name, 'value' => serialize($value)], 'name');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据库所有数据表
|
||||
* @return array [table, total, count]
|
||||
*/
|
||||
public function getTables(): array
|
||||
{
|
||||
$tables = [];
|
||||
foreach ($this->app->db->query("show tables") as $item) {
|
||||
$tables = array_merge($tables, array_values($item));
|
||||
}
|
||||
return [$tables, count($tables), 0];
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取数据内容
|
||||
* @param string $name
|
||||
|
@ -75,7 +75,7 @@ class QiniuStorage extends Storage
|
||||
* @param boolean $safe 安全模式
|
||||
* @param null|string $attname 下载名称
|
||||
* @return array
|
||||
* @throws \think\Exception
|
||||
* @throws \think\admin\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
@ -169,7 +169,7 @@ class QiniuStorage extends Storage
|
||||
/**
|
||||
* 获取文件上传地址
|
||||
* @return string
|
||||
* @throws \think\Exception
|
||||
* @throws \think\admin\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
@ -189,7 +189,7 @@ class QiniuStorage extends Storage
|
||||
case '东南亚':
|
||||
return "{$protocol}://up-as0.qiniup.com";
|
||||
default:
|
||||
throw new \think\Exception('未配置七牛云空间区域哦');
|
||||
throw new \think\admin\Exception('未配置七牛云空间区域哦');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user