mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:56:29 +00:00
fix: query table without primary key in mssql
This commit is contained in:
parent
3cc5bdeccc
commit
d9e972a0f3
@ -113,11 +113,15 @@ export class OptionsParser {
|
|||||||
sort = sort.split(',');
|
sort = sort.split(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
const primaryKeyField = this.model.primaryKeyAttribute;
|
let defaultSortField = this.model.primaryKeyAttribute;
|
||||||
|
|
||||||
if (primaryKeyField && !this.options?.group) {
|
if (!defaultSortField && this.collection.filterTargetKey) {
|
||||||
if (!sort.includes(primaryKeyField)) {
|
defaultSortField = this.collection.filterTargetKey;
|
||||||
sort.push(primaryKeyField);
|
}
|
||||||
|
|
||||||
|
if (defaultSortField && !this.options?.group) {
|
||||||
|
if (!sort.includes(defaultSortField)) {
|
||||||
|
sort.push(defaultSortField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user