fix: scope version group total count to current cross-review task only
This commit is contained in:
@@ -469,10 +469,14 @@ class CrossReviewServiceImpl(ICrossReviewService):
|
||||
LIMIT 1
|
||||
) df ON TRUE
|
||||
LEFT JOIN (
|
||||
SELECT version_group_key, COUNT(*) AS total_versions
|
||||
FROM leaudit_documents
|
||||
WHERE deleted_at IS NULL
|
||||
GROUP BY version_group_key
|
||||
SELECT d2.version_group_key, COUNT(*) AS total_versions
|
||||
FROM leaudit_documents d2
|
||||
JOIN leaudit_cross_review_task_documents td2
|
||||
ON td2.document_id = d2.id
|
||||
AND td2.delete_time IS NULL
|
||||
AND td2.task_id = :task_id
|
||||
WHERE d2.deleted_at IS NULL
|
||||
GROUP BY d2.version_group_key
|
||||
) vc ON vc.version_group_key = d.version_group_key
|
||||
WHERE {whereSql}
|
||||
ORDER BY d.created_at DESC, d.id DESC
|
||||
|
||||
Reference in New Issue
Block a user