refs #3520 hasUncheckedTicket
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Sergio De la torre 2024-03-27 07:48:16 +01:00
parent a983f25c57
commit 2cf572baf8
1 changed files with 7 additions and 7 deletions

View File

@ -27,13 +27,13 @@ module.exports = Self => {
const result = await Self.rawSql(`
SELECT tc2.ticketFk
FROM vn.ticketCollection tc
JOIN vn.ticketCollection tc2 ON tc2.collectionFk = tc.collectionFk
LEFT JOIN vn.ticketState ts ON ts.ticketFk = tc2.ticketFk
JOIN vn.state s ON s.id = ts.stateFk
JOIN vn.state s2 ON s2.code = 'CHECKED'
WHERE tc.ticketFk = ? AND s.order < s2.id
LIMIT 1;`,
FROM vn.ticketCollection tc
JOIN vn.ticketCollection tc2 ON tc2.collectionFk = tc.collectionFk
LEFT JOIN vn.ticketState ts ON ts.ticketFk = tc2.ticketFk
JOIN vn.state s ON s.id = ts.stateFk
JOIN vn.state s2 ON s2.code = 'CHECKED'
WHERE tc.ticketFk = ? AND s.order < s2.id
LIMIT 1;`,
[ticketFk], myOptions);
return result.length > 0 && result[0]['ticketFk'] > 0;
};