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…
Reference in new issue