You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Constrói a query para contar as avaliações com base no status.
430
+
*
431
+
* @param int|null $status Status da avaliação (0 = iniciada, 1 = concluída, 2 = enviada).
432
+
* @return int Retorna a contagem de avaliações.
433
+
*/
434
+
$buildQuery = function ($status = null) use ($user_ids, $opportunity, $conn): int {
435
+
$statusCondition = is_null($status) ? "e.status IS NULL" : "e.status = {$status} AND e.registration_id IN (SELECT r.id FROM registration r WHERE r.opportunity_id = {$opportunity->id})";
436
+
437
+
438
+
$query = "
439
+
SELECT DISTINCT count(e.registration_id)
440
+
FROM registration_evaluation e
441
+
WHERE {$statusCondition} AND user_id IN($user_ids)
442
+
";
443
+
444
+
return$conn->fetchScalar($query);
445
+
};
446
+
447
+
// Avaliações pendentes
448
+
$query = "
449
+
SELECT DISTINCT count(e.registration_id)
450
+
FROM evaluations e
451
+
WHERE opportunity_id = {$opportunity->id} AND e.evaluation_status IS NULL AND valuer_user_id IN ($user_ids)
0 commit comments