salix/print/templates/email/client-welcome/sql/client.sql

12 lines
353 B
MySQL
Raw Normal View History

2020-09-25 12:45:00 +00:00
SELECT
c.id,
u.name AS userName,
CONCAT(w.lastName, ' ', w.firstName) salesPersonName,
w.phone AS salesPersonPhone,
CONCAT(wu.name, '@verdnatura.es') AS salesPersonEmail
FROM client c
JOIN account.user u ON u.id = c.id
LEFT JOIN worker w ON w.id = c.salesPersonFk
2023-08-22 08:45:41 +00:00
LEFT JOIN account.user wu ON wu.id = w.id
WHERE c.id = ?