await cloud.callFunction({
name: 'queryalltable',
data: {
tbname: 'TUSER'
},
})
.then(res => {
db.collection('TMATCH').where({
season_id: season,
victory: uid,
status:'2',
}).count().then(res =>{
console.log(res.total)
})
})
- 调用云函数,查询表TUSER的全部数据
- 在回调中,查询表TMATCH的记录条数,在打印出条数
遇到问题:不执行console.log(res.total),这是什么原因?求助
试试这么写 const res = await cloud.callFunction({ name: 'queryalltable', data: { tbname: 'TUSER' }, }) db.collection('TMATCH').where({ season_id: season, victory: uid, status: '2', }).count().then(res => { console.log(res.total) })