4873-zone.delivery-day #1248
Labels
No Milestone
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#1248
Loading…
Reference in New Issue
No description provided.
Delete Branch "4873-zone.delivery-day"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix: corregido sqlto 4873-zone.delivery-day@ -30,8 +30,11 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
const dated = new Date(date);
Esto es necesario? Si se define el argumento como tipo Date debería llegar una fecha
@ -31,2 +31,4 @@
Object.assign(myOptions, options);
const dated = new Date(date);
const dayName = dated.toString().split(' ')[0];
No nesario si se pasa directamente date a la función
@ -49,1 +50,3 @@
OR INSTR(weekDays, SUBSTRING(DAYNAME(?), 1, 3) ) > 0
dated = ?
OR ? BETWEEN started AND ended
OR weekDays LIKE ?
Pasar la fecha directamnte y comparar así:
ze.weekDays & (1 << WEEKDAY(?))
Además hay que tener en cuenta el tipo de evento
type
.Todas las columnas de la consulta debería llevar el alias de la tabla.
@ -53,3 +56,3 @@
GROUP BY z.id`;
return Self.rawSql(query, [date, date, date, zoneIds], myOptions);
return Self.rawSql(query, [date, date, dayName, zoneIds], myOptions);
Pasar
date
en lugar dedayName
@ -54,0 +46,4 @@
(
ze.dated = ?
OR ? BETWEEN ze.started AND ze.ended
OR ze.weekDays & (1 << WEEKDAY(?))
S'ha de tindre en compte tambe la columna
type
dezoneEvent
, mira el WHERE del procedimentvn.zone_getOptionsForLanding
Pero aixo ja ho fa:
pq depen del camps q tinga rellenats es un type o altre.
Vale res, he vist q pot tindre started, ended y weekDays rellenat. Pensava q eren exclusius.
@ -54,0 +50,4 @@
)
AND z.id IN (?)
ORDER BY type='day' DESC, type='range' DESC, type='indefinitely' DESC) z
GROUP BY z.id;`;
N'hi ha una tabulació de mes en tota la consulta, punt i coma no fa falta al final si nomes es una consulta.