|
|
@@ -278,6 +278,18 @@ class PetTemp
|
|
|
return $userPetUpdates[$petId] ?? null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 清除用户的宠物更新临时数据
|
|
|
+ *
|
|
|
+ * @param int $userId 用户ID
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public static function clearUserPetUpdates(int $userId): void
|
|
|
+ {
|
|
|
+ $tempKey = self::TEMP_KEY_UPDATE_PREFIX . $userId;
|
|
|
+ Cache::put($tempKey, [], 0);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 清除用户的宠物创建临时数据
|
|
|
*
|