NGTools/uni_modules/uni-pay/uniCloud/cloudfunctions/uni-pay-co/dao/uniIdUsers.js
ldeyun 9dbfdc6c71 V1.0.0
微信小程序运行成功;
H5运行成功
2024-09-30 01:30:39 +08:00

26 lines
430 B
JavaScript

const dbName = {
user: "uni-id-users"
}
const db = uniCloud.database();
const _ = db.command;
var dao = {};
/**
* 获取 - 第三方支付订单数据
let userInfo = await dao.uniIdUsers.findById(id);
*/
dao.findById = async (id) => {
let res = await db.collection(dbName.user).doc(id).get();
if (res.data && res.data.length > 0) {
return res.data[0];
} else {
return null;
}
return res;
};
module.exports = dao;