Skip to content

Commit

Permalink
fix(setting_config_seeder): 确保config_select_data为数组类型 (#341)
Browse files Browse the repository at this point in the history
Closes #340
  • Loading branch information
People-Sea authored Aug 19, 2024
1 parent b3491ac commit a79bae6
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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 [email protected]
* @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();
}
}
}

0 comments on commit a79bae6

Please sign in to comment.