args[0] ?? 'user_id'; $instanceIdKey = $this->args[1] ?? 'instance_id'; $userId = $data[$userIdKey] ?? null; $instanceId = $data[$instanceIdKey] ?? null; if (!$userId) { $this->addError('用户ID不能为空'); return false; } // 检查用户是否拥有该宝箱 $res = ItemService::checkItemQuantity($userId, $itemId, 1, $instanceId); if ($res->error) { $this->addError('您没有该宝箱或宝箱不存在'); return false; } return true; } }