This commit is contained in:
archer
2023-06-06 10:20:50 +08:00
parent 942aeeac2e
commit 707be3362c
6 changed files with 23 additions and 20 deletions

View File

@@ -113,7 +113,7 @@ class Pg {
return pg.query<T>(sql);
}
async count(table: string, props: GetProps) {
const sql = `SELECT COUNT(*)
const sql = `SELECT COUNT(${props?.fields?.[0] || '*'})
FROM ${table}
${this.getWhereStr(props.where)}
`;