7806_devToTest_2332 #2801
|
@ -72,7 +72,9 @@ module.exports = Self => {
|
||||||
cn.name country,
|
cn.name country,
|
||||||
c.countryFk,
|
c.countryFk,
|
||||||
pm.name payMethod,
|
pm.name payMethod,
|
||||||
r.finished IS NULL hasRecovery
|
r.finished IS NULL hasRecovery,
|
||||||
|
dp.id departmentFk,
|
||||||
|
dp.name departmentName
|
||||||
FROM defaulter d
|
FROM defaulter d
|
||||||
JOIN client c ON c.id = d.clientFk
|
JOIN client c ON c.id = d.clientFk
|
||||||
JOIN country cn ON cn.id = c.countryFk
|
JOIN country cn ON cn.id = c.countryFk
|
||||||
|
@ -84,6 +86,8 @@ module.exports = Self => {
|
||||||
SELECT MAX(started), clientFk, finished
|
SELECT MAX(started), clientFk, finished
|
||||||
FROM recovery
|
FROM recovery
|
||||||
) r ON r.clientFk = c.id
|
) r ON r.clientFk = c.id
|
||||||
|
LEFT JOIN workerDepartment wd ON wd.workerFk = u.id
|
||||||
|
JOIN department dp ON dp.id = wd.departmentFk
|
||||||
WHERE
|
WHERE
|
||||||
d.created = ?
|
d.created = ?
|
||||||
AND d.amount > 0
|
AND d.amount > 0
|
||||||
|
|
Loading…
Reference in New Issue