提交 af605c93 编写于 作者: d-u-a's avatar d-u-a

fix(unicloud-db组件): 联表时调用 remove/update 报错的问题

上级 4d63d070
......@@ -381,7 +381,7 @@ export default {
db = db.action(action)
}
return db.collection(this.collection).doc(id).update(value).then((res) => {
return db.collection(this._getCollection()).doc(id).update(value).then((res) => {
success && success(res)
if (showToast) {
uni.showToast({
......@@ -528,7 +528,7 @@ export default {
exec = exec.action(action)
}
exec.collection(this.collection).where({
exec.collection(this._getCollection()).where({
_id: dbCmd.in(ids)
}).remove().then((res) => {
success && success(res.result)
......@@ -552,6 +552,11 @@ export default {
complete && complete()
})
},
_getCollection() {
const index = this.collection.indexOf(',')
const collection = index > 0 ? this.collection.substring(0, index) : this.collection
return collection
},
removeData(ids) {
const il = ids.slice(0)
const dl = this.dataList
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册