From d3e3034fbdcdf140369c32025e7f7dd68bba6c85 Mon Sep 17 00:00:00 2001 From: Rizki Date: Wed, 15 Apr 2026 14:56:51 +0700 Subject: [PATCH] upd --- emailnotif.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emailnotif.js b/emailnotif.js index c0c800d..2358d26 100644 --- a/emailnotif.js +++ b/emailnotif.js @@ -122,7 +122,7 @@ function notifyOnSubmit(idxjustification) { const qryApprover = ` select t.nik, e.fullname, e.email from tbl_justificationttd t - join dbssotcel.tbl_employee e on e.nik = t.nik + join dbssotcel.tbl_employee e on e.nik = t.nik AND email != '-' where t.idxjustification = '${idxjustification}' and t.issigned = 0 and t.isdeleted = 0 order by t._idx asc limit 1 `; @@ -160,7 +160,7 @@ function notifyOnSigned(idxjustification, signerNik) { const qryNext = ` select t.nik, e.fullname, e.email from tbl_justificationttd t - join dbssotcel.tbl_employee e on e.nik = t.nik + join dbssotcel.tbl_employee e on e.nik = t.nik AND email != '-' where t.idxjustification = '${idxjustification}' and t.issigned = 0 and t.isdeleted = 0 order by t._idx asc limit 1 `; @@ -195,7 +195,7 @@ function notifyOnReturn(idxjustification, returnerNik) { const creatorName = rows[0].creator_name; const creatorEmail = rows[0].creator_email; - const qryReturner = `select fullname from dbssotcel.tbl_employee where nik = '${returnerNik}' limit 1`; + const qryReturner = `select fullname from dbssotcel.tbl_employee where nik = '${returnerNik}' AND email != '-' limit 1`; db.query(qryReturner, [], function(err2, rows2) { if (err2 || rows2.length === 0) { console.error('[email-notif] notifyOnReturn: failed to get returner name', err2);