reportsModel->dbConnect(); try { $sql = 'SELECT * FROM queue_stats_mv WHERE datetime LIKE :receivedDate'; $stmt = $connection->prepare($sql); $data = $queryParams['data'] . '%'; $stmt->bindParam(':receivedDate', $data, \PDO::PARAM_STR); $stmt->execute(); $result = $stmt->fetchAll(\PDO::FETCH_ASSOC); return new Response( 200, ['Content-Type' => 'application/json'], json_encode(['success' => true, 'data' => $result], JSON_UNESCAPED_UNICODE) ); } catch (\PDOException $e) { return new Response( 500, ['Content-Type' => 'application/json'], json_encode(['error' => 'Erro ao executar a consulta: ' . $e->getMessage()]) ); } } }