...
|
...
|
@@ -527,18 +527,22 @@ const getShopCouponsList = (req, res, next) => { |
|
|
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
|
|
|
|
let uid = req.query.uid || req.user.uid;
|
|
|
let shopId = req.query.shopId;
|
|
|
let shopId = parseInt(req.query.shopId, 10);
|
|
|
let param = {};
|
|
|
|
|
|
if (uid) {
|
|
|
param.uid = uid;
|
|
|
}
|
|
|
if (shopId) {
|
|
|
if (uid) {
|
|
|
param.uid = uid;
|
|
|
}
|
|
|
|
|
|
param.shop_id = shopId;
|
|
|
param.shop_id = shopId;
|
|
|
|
|
|
listModel.shopCouponsList(param).then(result => {
|
|
|
res.json(result);
|
|
|
}).catch(next);
|
|
|
listModel.shopCouponsList(param).then(result => {
|
|
|
res.json(result);
|
|
|
}).catch(next);
|
|
|
} else {
|
|
|
res.json([]);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -555,18 +559,22 @@ const getBrandCouponsList = (req, res, next) => { |
|
|
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
|
|
|
|
let uid = req.query.uid || req.user.uid;
|
|
|
let brandId = req.query.brandId;
|
|
|
let brandId = parseInt(req.query.brandId, 10);
|
|
|
let param = {};
|
|
|
|
|
|
if (uid) {
|
|
|
param.uid = uid;
|
|
|
}
|
|
|
if (brandId) {
|
|
|
if (uid) {
|
|
|
param.uid = uid;
|
|
|
}
|
|
|
|
|
|
param.brand_id = brandId;
|
|
|
param.brand_id = brandId;
|
|
|
|
|
|
listModel.brandCouponsList(param).then(result => {
|
|
|
res.json(result);
|
|
|
}).catch(next);
|
|
|
listModel.brandCouponsList(param).then(result => {
|
|
|
res.json(result);
|
|
|
}).catch(next);
|
|
|
} else {
|
|
|
res.json([]);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
...
|
...
|
|