完成order数据交互层

catten-backend
fdzcxy212206317 8 months ago
parent a277b698d4
commit 21dd1911c4

@ -0,0 +1,34 @@
const orderModel = require("./model/orderModel")
module.exports.getOrderDao = async function (id) {
if (id) {
console.log(id, "idDAO")
return await orderModel.findAll({
where: {
userId: id
}
})
}
return await orderModel.findAll()
}
module.exports.addOrderDao = async function (dishData) {
await orderModel.create(dishData)
return await orderModel.findAll()
}
// module.exports.updateOrderDao = async function (dishData) {
// await orderModel.update(dishData, {
// where: {
// id: dishData.id
// }
// })
// return await orderModel.findAll()
// }
// module.exports.deleteOrderDao = async function (id) {
// await orderModel.destroy({
// where: {
// id
// }
// })
// return await orderModel.findAll()
// }
Loading…
Cancel
Save