diff --git a/v1/resources/notification_ls.cfc b/v1/resources/notification_ls.cfc index 1955f47..8568a7f 100644 --- a/v1/resources/notification_ls.cfc +++ b/v1/resources/notification_ls.cfc @@ -50,20 +50,23 @@ select - n.notification_uid + n.notification_uid::text as notification_uid n.notification n.descr - n.descr - to_char(s.dt_show_from, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_show_from - to_char(s.dt_show_to, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_show_to - to_char(s.dt_created, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_created - to_char(s.dt_updated, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_updated + n.contragent_id + k.external_uid + as arguments_company_uid + to_char(n.dt_show_from, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_show_from + to_char(n.dt_show_to, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_show_to + from notification n + left outer join contragent k on (n.contragent_id=k.contragent_id) where 1=1 AND (n.dt_show_from <= CURRENT_TIMESTAMP OR n.dt_show_from IS NULL) AND (n.dt_show_to >= CURRENT_TIMESTAMP OR n.dt_show_to IS NULL) - AND (n.companyId = OR n.companyId IS NULL) + AND (k.external_uid = OR n.contragent_id IS NULL) order by dt_show_from desc limit #maxrows# @@ -73,11 +76,11 @@ select count(*) as cnt from notification n - where 1=1 + left outer join contragent k on (n.contragent_id=k.contragent_id) + where 1=1 AND (n.dt_show_from <= CURRENT_TIMESTAMP OR n.dt_show_from IS NULL) AND (n.dt_show_to >= CURRENT_TIMESTAMP OR n.dt_show_to IS NULL) - AND (n.companyId = OR n.companyId IS NULL) - order by dt_show_from desc + AND (k.external_uid = OR n.contragent_id IS NULL) diff --git a/v1/resources/user.cfc b/v1/resources/user.cfc index 35eb52e..c9a5740 100644 --- a/v1/resources/user.cfc +++ b/v1/resources/user.cfc @@ -50,6 +50,7 @@ u.usr_id u.login k.contragent_id + k.external_uid::text as external_uid k.contragent from usr u