Skip to content

Commit b726f30

Browse files
Fix SQL quotes for database compatibility
Co-authored-by: delicatacurtis <247246500+delicatacurtis@users.noreply.github.com>
1 parent bcc33e2 commit b726f30

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/Services/HandwritingRecognitionService.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,13 @@ public function getTeamStats(int $teamId): array
237237
{
238238
// Get all statistics in a single optimized query
239239
$stats = DocumentTranscription::where('team_id', $teamId)
240-
->selectRaw('
240+
->selectRaw("
241241
COUNT(*) as total,
242-
SUM(CASE WHEN status = "completed" THEN 1 ELSE 0 END) as completed,
243-
SUM(CASE WHEN status = "pending" THEN 1 ELSE 0 END) as pending,
244-
SUM(CASE WHEN status = "failed" THEN 1 ELSE 0 END) as failed,
245-
AVG(CASE WHEN status = "completed" THEN JSON_EXTRACT(metadata, "$.confidence") ELSE NULL END) as avg_confidence
246-
')
242+
SUM(CASE WHEN status = 'completed' THEN 1 ELSE 0 END) as completed,
243+
SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END) as pending,
244+
SUM(CASE WHEN status = 'failed' THEN 1 ELSE 0 END) as failed,
245+
AVG(CASE WHEN status = 'completed' THEN JSON_EXTRACT(metadata, '$.confidence') ELSE NULL END) as avg_confidence
246+
")
247247
->first();
248248

249249
// Get total corrections count

0 commit comments

Comments
 (0)