fix: corregido sql
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
1f1a69a2b4
commit
484b8d42e1
|
@ -30,6 +30,9 @@ module.exports = Self => {
|
|||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
const dated = new Date(date);
|
||||
const dayName = dated.toString().split(' ')[0];
|
||||
|
||||
query = `
|
||||
SELECT *
|
||||
FROM (
|
||||
|
@ -46,12 +49,12 @@ module.exports = Self => {
|
|||
(
|
||||
dated = ?
|
||||
OR ? BETWEEN started AND ended
|
||||
OR INSTR(weekDays, SUBSTRING(DAYNAME(?), 1, 3) ) > 0
|
||||
OR weekDays LIKE ?
|
||||
)
|
||||
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, dayName, zoneIds], myOptions);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue