|
|
@@ -725,7 +725,15 @@ function refreshPreview() {
|
|
|
$sth = DB::getPDO()->prepare("
|
|
|
select n.`who`, n.`when`, n.`what`, UNIX_TIMESTAMP(n.last_exec_time) as last_exec_time
|
|
|
from ADMIN_USERS u
|
|
|
- left join CRM_NOTIFY n on(n.`who` = u.ADM_ACCOUNT)
|
|
|
+ left join CRM_NOTIFY n on(n.`who` = u.ADM_ACCOUNT
|
|
|
+ and (
|
|
|
+ n.`when` = 'once_a_day' and (
|
|
|
+ n.last_exec_time is null
|
|
|
+ or DATE(n.last_exec_time) < CURDATE()
|
|
|
+ )
|
|
|
+ -- TODO add `or` with another `when` values
|
|
|
+ )
|
|
|
+ )
|
|
|
where u.A_STATUS = 'NORMAL'
|
|
|
and u.EMPLOYEE_TYPE = 'Pracownik'
|
|
|
and n.`who` is not null
|