mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 04:05:45 +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(',');
|
||||
}
|
||||
|
||||
const primaryKeyField = this.model.primaryKeyAttribute;
|
||||
let defaultSortField = this.model.primaryKeyAttribute;
|
||||
|
||||
if (primaryKeyField && !this.options?.group) {
|
||||
if (!sort.includes(primaryKeyField)) {
|
||||
sort.push(primaryKeyField);
|
||||
if (!defaultSortField && this.collection.filterTargetKey) {
|
||||
defaultSortField = this.collection.filterTargetKey;
|
||||
}
|
||||
|
||||
if (defaultSortField && !this.options?.group) {
|
||||
if (!sort.includes(defaultSortField)) {
|
||||
sort.push(defaultSortField);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user