获得过 0 次赞
回答过的问题获得 0 次赞
分享过的文章/案例获得 0 次赞
评论与回复获得 0 次赞
- 云数据库的where语句无法筛选数据?
数据集合'zhongdui'包含一个记录M,M字段的_openid非空 console.log(this.data.openid) var rr =await db.collection('zhongdui').where({ _openid:this.data.openid }).get() console.log(rr) //运行后发现this.data.openid为任意值rr都能取到M
2019-10-31 - 全局变量在then内赋值后在函数外调用内容为空?
var dm db.collection('zhongdui').where({ _openid: this.data.openid }).get().then(res => {dm=res.data[0],console.log(dm)}) //打印结果为{duiming: {…}} console.log(dm) //打印结果为undefined
2019-10-29 - 无法通过全局变量获得openid?
wx.login({ success(res) { //发起网络请求 wx.cloud.callFunction({ name: 'login' }).then(res => console.log(res)).then(db.collection('zhongdui').add({ data: { openid: res.result } })).then( kkid = res.result, ) } }) 其中kkid为全局变量,函数运行后kkid的值为undefined
2019-10-28