add: reminder whatsapp sparepart monthly
This commit is contained in:
@@ -139,11 +139,26 @@ const getDeviceReminderChanelDb = async (id) => {
|
||||
return result.recordset;
|
||||
};
|
||||
|
||||
const getDeviceReminderMonthlyDb = async (id) => {
|
||||
const queryText = `
|
||||
SELECT
|
||||
a.*,
|
||||
b.brand_name,
|
||||
COALESCE(a.device_code, '') + ' - ' + COALESCE(a.device_name, '') AS device_code_name
|
||||
FROM m_device a
|
||||
LEFT JOIN m_brands b ON a.brand_id = b.brand_id
|
||||
WHERE a.device_id = $1 AND a.deleted_at IS NULL AND a.reminder_at_monthly IS NOT NULL
|
||||
`;
|
||||
const result = await pool.query(queryText, [id]);
|
||||
return result.recordset;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getAllDevicesDb,
|
||||
getDeviceByIdDb,
|
||||
createDeviceDb,
|
||||
updateDeviceDb,
|
||||
deleteDeviceDb,
|
||||
getDeviceReminderChanelDb
|
||||
getDeviceReminderChanelDb,
|
||||
getDeviceReminderMonthlyDb
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user