res jobs this- dbRead- select SELECT date_format pr urgent_time_to urg

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$res['jobs'] = $this->dbRead->select("SELECT *, date_format(pr.urgent_time_to, '%H:%i') urgent_time_to, date_format(pr.urgent_time_from, '%H:%i')
urgent_time_from, DATEDIFF(NOW(), pr.date) date, DATEDIFF(pr.urgent_date, NOW()) urgent_date, ci.name city_name,
au.name user_name, pr.id request_id
FROM parent_requests pr
JOIN accounts_users au ON au.id = pr.parent_id
JOIN cities ci ON pr.city_id = ci.id
JOIN join_parent_regions jpr ON au.id = jpr.user_id
JOIN cities ci2 ON jpr.region_id = ci2.id
WHERE au.name != ''
" . $filter . "
AND (DATEDIFF(pr.urgent_date, NOW()) >= 0 || pr.urgent_date = false)
ORDER BY request_type, " . $order . "
LIMIT " . (($page - 1) * $offset) . ", " . $offset, $bounds);