diff --git a/CHANGELOG.md b/CHANGELOG.md index 91ce818a8..6533a84ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ### Changed -- +- (General -> Inicio) Ahora permite recuperar la contraseña tanto con el correo de recuperación como el usuario ### Fixed -- +- (Monitor de tickets) Cuando ordenas por columna, ya no se queda deshabilitado el botón de 'Actualizar' +- (Zone -> Días de entrega) Al hacer click en un día, muestra correctamente las zonas ## [2304.01] - 2023-02-09 diff --git a/modules/zone/back/methods/zone/getZoneClosing.js b/modules/zone/back/methods/zone/getZoneClosing.js index 2a0088203..76706b55c 100644 --- a/modules/zone/back/methods/zone/getZoneClosing.js +++ b/modules/zone/back/methods/zone/getZoneClosing.js @@ -31,7 +31,7 @@ module.exports = Self => { Object.assign(myOptions, options); query = ` - SELECT * + SELECT * FROM ( SELECT DISTINCT z.id, @@ -40,18 +40,21 @@ module.exports = Self => { IFNULL(ze.hour, z.hour) as hour, IFNULL(ze.price, z.price) as price FROM vn.zone z - JOIN agencyMode am ON am.id = z.agencyModeFk - LEFT JOIN zoneEvent ze ON ze.zoneFk = z.id - WHERE - ( - dated = ? - OR ? BETWEEN started AND ended - OR INSTR(weekDays, SUBSTRING(DAYNAME(?), 1, 3) ) > 0 - ) + JOIN vn.agencyMode am ON am.id = z.agencyModeFk + LEFT JOIN vn.zoneEvent ze ON ze.zoneFk = z.id + WHERE (( + ze.type = 'day' + AND ze.dated = ? + ) OR ( + ze.type != 'day' + AND ze.weekDays & (1 << WEEKDAY(?)) + AND (ze.started IS NULL OR ? >= ze.started) + AND (ze.ended IS NULL OR ? <= ze.ended) + )) AND z.id IN (?) ORDER BY type='day' DESC, type='range' DESC, type='indefinitely' DESC) z GROUP BY z.id`; - return Self.rawSql(query, [date, date, date, zoneIds], myOptions); + return Self.rawSql(query, [date, date, date, date, zoneIds], myOptions); }; };