|
@@ -10,6 +10,8 @@ use SixShop\System\Model\ExtensionModel;
|
|
|
use think\console\Command;
|
|
use think\console\Command;
|
|
|
use think\db\exception\PDOException;
|
|
use think\db\exception\PDOException;
|
|
|
|
|
|
|
|
|
|
+use function SixShop\Core\extension_name_list;
|
|
|
|
|
+
|
|
|
class CoreExtensionConfigCommand extends Command
|
|
class CoreExtensionConfigCommand extends Command
|
|
|
{
|
|
{
|
|
|
public function configure(): void
|
|
public function configure(): void
|
|
@@ -25,11 +27,10 @@ class CoreExtensionConfigCommand extends Command
|
|
|
$force = $this->input->getOption('force');
|
|
$force = $this->input->getOption('force');
|
|
|
$extensionManager = $this->app->make(ExtensionManager::class);
|
|
$extensionManager = $this->app->make(ExtensionManager::class);
|
|
|
// 确保系统扩展迁移已安装
|
|
// 确保系统扩展迁移已安装
|
|
|
- $moduleList = array_diff(Helper::extension_name_list(), ['system']);
|
|
|
|
|
|
|
+ $moduleList = array_diff(extension_name_list(), ['system']);
|
|
|
array_unshift($moduleList, 'system');
|
|
array_unshift($moduleList, 'system');
|
|
|
try {
|
|
try {
|
|
|
- $installModuleList = ExtensionModel::where(['is_core' => 0])
|
|
|
|
|
- ->where('status', '>', 1)
|
|
|
|
|
|
|
+ $installModuleList = ExtensionModel::where('status', '>', 1)
|
|
|
->column('id');
|
|
->column('id');
|
|
|
} catch (PDOException $e) {
|
|
} catch (PDOException $e) {
|
|
|
$installModuleList = [];
|
|
$installModuleList = [];
|
|
@@ -42,7 +43,7 @@ class CoreExtensionConfigCommand extends Command
|
|
|
} catch (PDOException $e) {
|
|
} catch (PDOException $e) {
|
|
|
$config = [];
|
|
$config = [];
|
|
|
}
|
|
}
|
|
|
- if ((isset($info['is_core']) && $info['is_core'] == 1) || in_array($moduleName, $installModuleList)) {
|
|
|
|
|
|
|
+ if (in_array($moduleName, $installModuleList)) {
|
|
|
$migrate = app(Migrate::class, [$this->app, $moduleName], true);
|
|
$migrate = app(Migrate::class, [$this->app, $moduleName], true);
|
|
|
if ($force) {
|
|
if ($force) {
|
|
|
$migrate->uninstall();
|
|
$migrate->uninstall();
|
|
@@ -74,4 +75,4 @@ class CoreExtensionConfigCommand extends Command
|
|
|
$this->output->writeln('');
|
|
$this->output->writeln('');
|
|
|
$this->output->writeln('<comment>All Done. Took ' . sprintf('%.4fs', $end - $start) . '</comment>');
|
|
$this->output->writeln('<comment>All Done. Took ' . sprintf('%.4fs', $end - $start) . '</comment>');
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+}
|