- 修改用户查询方法以包含软删除的用户记录 - 确保在处理余额变更时能够正确获取所有用户状态 - 避免因用户被软删除而导致的查询异常
@@ -17,7 +17,7 @@ class ExtensionBalpayLogEntity extends BaseEntity
public function change(int $userID, float $amount, BalpayLogTypeEnum $type, string $description, int $orderID = 0): void
{
- $user = User::find($userID);
+ $user = User::withTrashed()->find($userID);
if (!$user) {
throw new \RuntimeException('用户不存在');
}