diff --git a/dao/orderDao.js b/dao/orderDao.js new file mode 100644 index 0000000..102e915 --- /dev/null +++ b/dao/orderDao.js @@ -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() +// } \ No newline at end of file