You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
canteen/uniCloud-aliyun/cloudfunctions/getLabels/index.js

14 lines
311 B

'use strict';
exports.main = async (event, context) => {
const db = uniCloud.database()
let labelList = []
const res = db.collection('dish-label').where({
dish_id:event.id
})
for(int i = 0;i < res.data.length;i++) {
labelList.push(res.data[i].label)
}
//返回数据给客户端
return labelList
};