-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(setting_config_seeder): 确保config_select_data为数组类型 (#341)
Closes #340
- Loading branch information
1 parent
b3491ac
commit a79bae6
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
app/Setting/Database/Seeders/Update/setting_config_seeder_update.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |