6275-silex-to-salix #1878

Merged
sergiodt merged 12 commits from 6275-silex-to-salix into dev 2023-12-14 05:52:08 +00:00
1 changed files with 9 additions and 3 deletions
Showing only changes of commit 4071c06b5f - Show all commits

View File

@ -3,7 +3,7 @@ const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('getTickets', { Self.remoteMethod('getTickets', {
description: 'Return the tickets information displayed on the route module', description: 'Find all instances of the model matched by filter from the data source.',
accessType: 'READ', accessType: 'READ',
accepts: [ accepts: [
{ {
@ -55,7 +55,12 @@ module.exports = Self => {
c.phone ClientPhone, c.phone ClientPhone,
c.mobile ClientMobile, c.mobile ClientMobile,
a.phone AddressPhone, a.phone AddressPhone,
a.mobile AddressMobile a.mobile AddressMobile,
a.longitude,
a.latitude,
wm.mediaValue SalePersonPhone,
t.cmrFk,
t.isSigned Signed
FROM vn.route r FROM vn.route r
JOIN ticket t ON t.routeFk = r.id JOIN ticket t ON t.routeFk = r.id
JOIN client c ON t.clientFk = c.id JOIN client c ON t.clientFk = c.id
@ -70,7 +75,8 @@ module.exports = Self => {
LEFT JOIN address a ON a.id = t.addressFk LEFT JOIN address a ON a.id = t.addressFk
LEFT JOIN agencyMode am ON am.id = t.agencyModeFk LEFT JOIN agencyMode am ON am.id = t.agencyModeFk
LEFT JOIN account.user u ON u.id = r.workerFk LEFT JOIN account.user u ON u.id = r.workerFk
LEFT JOIN vehicle v ON v.id = r.vehicleFk` LEFT JOIN vehicle v ON v.id = r.vehicleFk
LEFT JOIN workerMedia wm ON wm.workerFk = c.salesPersonFk`
); );
if (!filter.where) filter.where = {}; if (!filter.where) filter.where = {};