where('store_id', $storeId) ->first(); return $config ? $config->value : $default; } /** * 设置配置值 */ public static function setValue(string $key, $value, ?int $storeId = null, string $group = 'general'): void { self::updateOrCreate( ['key' => $key, 'store_id' => $storeId], ['value' => $value, 'group' => $group] ); } }