...
|
...
|
@@ -15,7 +15,7 @@ const orderModel = require('../models/order'); |
|
|
const index = (req, res) => {
|
|
|
const type = req.query.type;
|
|
|
const page = req.query.page;
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
|
|
|
orderModel.getOrderData(uid, type, page).then(result => {
|
|
|
res.display('index', {
|
...
|
...
|
@@ -32,7 +32,7 @@ const index = (req, res) => { |
|
|
|
|
|
const detail = (req, res) => {
|
|
|
const code = req.query.code;
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
|
|
|
orderModel.getOrderDetail(uid, code).then(result => {
|
|
|
res.display('index', {
|
...
|
...
|
@@ -50,7 +50,7 @@ const detail = (req, res) => { |
|
|
const getOrderList = (req, res) => {
|
|
|
const type = req.query.type;
|
|
|
const page = req.query.page;
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
|
|
|
orderModel.getOrderData(uid, type, page).then(result => {
|
|
|
res.display('order-table', {
|
...
|
...
|
@@ -67,7 +67,7 @@ const getOrderList = (req, res) => { |
|
|
|
|
|
const getOrderTotal = (req, res) => {
|
|
|
const type = req.query.type;
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
|
|
|
|
|
|
orderModel.getOrderData(uid, type).then(result => {
|
...
|
...
|
@@ -80,7 +80,7 @@ const getOrderTotal = (req, res) => { |
|
|
};
|
|
|
|
|
|
const cancelOrder = (req, res) => {
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
const data = req.query;
|
|
|
|
|
|
orderModel.cancelOrder(uid, data).then(result => {
|
...
|
...
|
@@ -89,7 +89,7 @@ const cancelOrder = (req, res) => { |
|
|
};
|
|
|
|
|
|
const deleteOrder = (req, res) => {
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
const code = req.query.orderCode;
|
|
|
|
|
|
orderModel.deleteOrder(uid, code).then(result => {
|
...
|
...
|
@@ -98,7 +98,7 @@ const deleteOrder = (req, res) => { |
|
|
};
|
|
|
|
|
|
const getExpressInfo = (req, res) => {
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
const code = req.query.orderCode;
|
|
|
|
|
|
orderModel.getExpressInfo(uid, code).then(result => {
|
...
|
...
|
@@ -113,7 +113,7 @@ const getCancelOrderReason = (req, res) => { |
|
|
};
|
|
|
|
|
|
const editOrder = (req, res) => {
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
const query = req.query;
|
|
|
|
|
|
query.uid = uid;
|
...
|
...
|
@@ -124,7 +124,7 @@ const editOrder = (req, res) => { |
|
|
};
|
|
|
|
|
|
const reAdd = (req, res) => {
|
|
|
const uid = req.user.uid || '10931021';
|
|
|
const uid = req.user.uid;
|
|
|
const code = req.query.orderCode;
|
|
|
|
|
|
orderModel.reAddCart(uid, code).then(result => {
|
...
|
...
|
@@ -132,6 +132,15 @@ const reAdd = (req, res) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const confirmReceive = (req, res) => {
|
|
|
const uid = req.user.uid;
|
|
|
const code = req.query.orderCode;
|
|
|
|
|
|
orderModel.confirmReceive(uid, code).then(result => {
|
|
|
res.json(result);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
index,
|
|
|
detail,
|
...
|
...
|
@@ -142,5 +151,6 @@ module.exports = { |
|
|
editOrder,
|
|
|
getExpressInfo,
|
|
|
getCancelOrderReason,
|
|
|
reAdd
|
|
|
reAdd,
|
|
|
confirmReceive
|
|
|
}; |
...
|
...
|
|