From a79bae66fb966bcee1c7fb3f76edc15eb1109474 Mon Sep 17 00:00:00 2001 From: WenRenHai <PeopleSea@outlook.com> Date: Mon, 19 Aug 2024 21:34:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(setting=5Fconfig=5Fseeder):=20=E7=A1=AE?= =?UTF-8?q?=E4=BF=9Dconfig=5Fselect=5Fdata=E4=B8=BA=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20(#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #340 --- .../Update/setting_config_seeder_update.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 app/Setting/Database/Seeders/Update/setting_config_seeder_update.php diff --git a/app/Setting/Database/Seeders/Update/setting_config_seeder_update.php b/app/Setting/Database/Seeders/Update/setting_config_seeder_update.php new file mode 100644 index 00000000..cbbe3dd3 --- /dev/null +++ b/app/Setting/Database/Seeders/Update/setting_config_seeder_update.php @@ -0,0 +1,31 @@ +<?php + +declare(strict_types=1); +/** + * This file is part of MineAdmin. + * + * @link https://www.mineadmin.com + * @document https://doc.mineadmin.com + * @contact root@imoi.cn + * @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE + */ +use App\Setting\Model\SettingConfig; +use Hyperf\Database\Seeders\Seeder; + +class SettingConfigSeederUpdate extends Seeder +{ + /** + * Run the database seeds. + */ + public function run() + { + $setting = SettingConfig::query()->where([ + 'key' => 'upload_mode', + 'group_id' => 2, + ])->first(); + if ($setting && isset($setting->config_select_data) && is_string($setting->config_select_data)) { + $setting->config_select_data = json_decode($setting->config_select_data, true); + $setting->save(); + } + } +}