$e->getMessage(), 'user_id' => $userId, ]); return []; } } /** * 获取用户特定神像类型的变更临时数据 * * @param int $userId 用户ID * @param int $godType 神像类型 * @return GodChangeTempDto|null 神像变更数据,不存在时返回null */ public static function getUserGodChange(int $userId, int $godType): ?GodChangeTempDto { try { return GodTemp::getUserGodChange($userId, $godType); } catch (\Exception $e) { Log::error('获取用户特定神像变更临时数据失败', [ 'error' => $e->getMessage(), 'user_id' => $userId, 'god_type' => $godType, ]); return null; } } /** * 清除用户的神像变更临时数据 * * @param int $userId 用户ID * @return void */ public static function clearUserGodChanges(int $userId): void { try { GodTemp::clearUserGodChanges($userId); } catch (\Exception $e) { Log::error('清除用户神像变更临时数据失败', [ 'error' => $e->getMessage(), 'user_id' => $userId, ]); } } /** * 清除用户特定神像类型的变更临时数据 * * @param int $userId 用户ID * @param int $godType 神像类型 * @return void */ public static function clearUserGodChange(int $userId, int $godType): void { try { GodTemp::clearUserGodChange($userId, $godType); } catch (\Exception $e) { Log::error('清除用户特定神像变更临时数据失败', [ 'error' => $e->getMessage(), 'user_id' => $userId, 'god_type' => $godType, ]); } } }