''),
IFNULL(contacts.address, ''),
IFNULL(contacts.city, ''),
IFNULL(contacts.state, ''),
IFNULL(contacts.postalcode, ''),
IFNULL(campaigns.name, ''),
IFNULL(contacts.status, ''),
cdrs.clientid,
clients.name,
cdrs.callid,
cdrs.voicemailid
FROM cdrs
inner join clients ON clients.id = cdrs.clientid
JOIN dids ON dids.id = cdrs.didid
LEFT JOIN users AS agents ON agents.id = cdrs.agentid
LEFT JOIN dispositions ON dispositions.id = cdrs.dispositionid
LEFT JOIN contacts ON contacts.id = cdrs.contactid
LEFT JOIN campaigns ON campaigns.id = cdrs.campaignid
WHERE 1=1
AND cdrs.clientid in ([список id из запроса выше])
AND (cdrs.calldate >= '2021-08-24 15:59:59.999')
AND (cdrs.calldate <= '2021-08-31 15:59:59.999')
order by id desc
limit 25;
https://pastebin.com/xw9DZZgW
не не не. В IN нужно передать прям идентификаторы, а не вписать запрос
Обсуждают сегодня