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')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
const dated = new Date(date);
|
||||||
|
const dayName = dated.toString().split(' ')[0];
|
||||||
|
|
||||||
query = `
|
query = `
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM (
|
FROM (
|
||||||
|
@ -46,12 +49,12 @@ module.exports = Self => {
|
||||||
(
|
(
|
||||||
dated = ?
|
dated = ?
|
||||||
OR ? BETWEEN started AND ended
|
OR ? BETWEEN started AND ended
|
||||||
OR INSTR(weekDays, SUBSTRING(DAYNAME(?), 1, 3) ) > 0
|
OR weekDays LIKE ?
|
||||||
)
|
)
|
||||||
AND z.id IN (?)
|
AND z.id IN (?)
|
||||||
ORDER BY type='day' DESC, type='range' DESC, type='indefinitely' DESC) z
|
ORDER BY type='day' DESC, type='range' DESC, type='indefinitely' DESC) z
|
||||||
GROUP BY z.id`;
|
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