diff --git a/packages/uni-cli-shared/components/unicloud-db.vue b/packages/uni-cli-shared/components/unicloud-db.vue index fc079218bc7578eda0b76615c7cb940670d21177..4440b8d60886d8264cbc38fb605e256e1b66a138 100644 --- a/packages/uni-cli-shared/components/unicloud-db.vue +++ b/packages/uni-cli-shared/components/unicloud-db.vue @@ -441,15 +441,15 @@ export default { db = db.collection(...this.collectionArgs) + if (this.foreignKey) { + db = db.foreignKey(this.foreignKey) + } if (!(!this.where || !Object.keys(this.where).length)) { db = db.where(this.where) } if (this.field) { db = db.field(this.field) } - if (this.foreignKey) { - db = db.foreignKey(this.foreignKey) - } if (this.groupby) { db = db.groupBy(this.groupby) }