fix: refs #6184 saveSign
This commit is contained in:
parent
413f7eb8c8
commit
a359ace1b8
|
@ -59,19 +59,15 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
async function hasSignDms(ticketId) {
|
||||
const ticketDms = await models.TicketDms.findOne({
|
||||
where: {ticketFk: ticketId},
|
||||
include: [
|
||||
{
|
||||
relation: 'dms',
|
||||
fields: ['id'],
|
||||
scope: {
|
||||
where: {dmsTypeFk: dmsTypeTicket.id}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
if (ticketDms?.dms()?.id) return true;
|
||||
const hasTicketDms = await Self.rawSql(`
|
||||
SELECT d.id
|
||||
FROM ticketDms td
|
||||
JOIN dms d ON d.id = td.dmsFk
|
||||
WHERE td.ticketFk = ?
|
||||
AND d.dmsTypeFk = ?
|
||||
`, [ticketId, dmsTypeTicket.id]);
|
||||
|
||||
if (hasTicketDms.length) return true;
|
||||
}
|
||||
|
||||
async function createGestDoc() {
|
||||
|
|
Loading…
Reference in New Issue