forked from Wroclaw/WorkshopTasker
fixup where
This commit is contained in:
parent
b14cf774ec
commit
775cc2e1db
1 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,7 @@ export default class BaaPagination<T extends {[k: string]: any}, keyType extends
|
|||
where = "",
|
||||
bind: Array<any> = [],
|
||||
) {
|
||||
const sqlwhere = where ? `AND (${where})` : "";
|
||||
const sqlwhere = where !== "" ? `AND (${where})` : "";
|
||||
switch (queryType.type) {
|
||||
case "before": {
|
||||
const [data] = await database.query(
|
||||
|
@ -232,7 +232,7 @@ export default class BaaPagination<T extends {[k: string]: any}, keyType extends
|
|||
where = "",
|
||||
bind: Array<any> = [],
|
||||
) {
|
||||
const sqlwhere = where ? `WHERE ${where}` : "";
|
||||
const sqlwhere = where !== "" ? `WHERE ${where}` : "";
|
||||
const [[data]] = await database.query(
|
||||
`SELECT COUNT(*) as \`count\` FROM \`${this.table}\` ${sqlwhere}`,
|
||||
bind,
|
||||
|
|
Loading…
Reference in a new issue