请问 云开发 资源 耗尽 太快了 有啥好解决方法嘛,我用专业版(82元一个月),一天大约10个人用,两三个小时 读写数据 给用了完,有啥方法优化的嘛
- 发布:2023-06-22 10:23
- 更新:2023-06-23 12:25
- 阅读:284
2***@qq.com - 微垠互联科技工作室wx:z2509082022,承接uniapp+unicloud项目
这段代码是否可以改成联表查询,这种写法很消耗资源cl_consume.where({boxid}).orderBy("_id desc").skip(skipcCount).limit(8).field("result,uid,boxid,nowtime").get().then(async res => {
let list = res.result.data;
let fallingList = [];
for (var i = 0; i < list.length; i++) {
let uid = list[i].uid;
let nowtime=list[i].nowtime;
let item = await new Promise((resovle, reject) => {
cl_user.where({
uid
}).field("nickName,avatarUrl").get({
getOne: true
}).then(res => {
resovle(res.result.data);
})
});
if (item.nickName) {
list[i]['nickName'] = global.formatName(item.nickName);
list[i]['avatarUrl'] = item.avatarUrl;
list[i]['nowtime']=nowtime;
}
let results = list[i].result;
for (var j = 0; j < results.length; j++) {
results[j]['nickName'] =global.formatName(item.nickName);
results[j]['avatarUrl'] = item.avatarUrl;
results[j]['nowtime'] = nowtime;
fallingList.push(results[j]);
}
2***@qq.com (作者)
可以的
2023-07-02 10:05
2***@qq.com (作者)
感谢
2023-07-02 10:05