fix: 统一count的结果类型,postgres需要转换为number
This commit is contained in:
parent
5035f0d520
commit
789580fd82
|
|
@ -195,8 +195,17 @@ class PostgreSQLStore extends CascadeStore_1.CascadeStore {
|
|||
}
|
||||
else {
|
||||
// TODO: 这里和mysql统一行为,id字段为char类型时,去除后面的空格
|
||||
if (value && typeof value === 'string' && attr === 'id') {
|
||||
r[attr] = value.trim();
|
||||
if (value && typeof value === 'string') {
|
||||
if (attr === 'id') {
|
||||
r[attr] = value.trim();
|
||||
}
|
||||
else if (attr.startsWith("#count")) {
|
||||
// PostgreSQL count 返回字符串
|
||||
r[attr] = parseInt(value, 10);
|
||||
}
|
||||
else {
|
||||
r[attr] = value;
|
||||
}
|
||||
}
|
||||
else {
|
||||
r[attr] = value;
|
||||
|
|
|
|||
|
|
@ -260,8 +260,15 @@ export class PostgreSQLStore<
|
|||
}
|
||||
} else {
|
||||
// TODO: 这里和mysql统一行为,id字段为char类型时,去除后面的空格
|
||||
if (value && typeof value === 'string' && attr === 'id') {
|
||||
r[attr] = value.trim();
|
||||
if (value && typeof value === 'string') {
|
||||
if (attr === 'id') {
|
||||
r[attr] = value.trim();
|
||||
} else if (attr.startsWith("#count")) {
|
||||
// PostgreSQL count 返回字符串
|
||||
r[attr] = parseInt(value, 10);
|
||||
} else {
|
||||
r[attr] = value;
|
||||
}
|
||||
} else {
|
||||
r[attr] = value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue