Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
8 years ago
Commit
2b8422e23e69b4b484fd2e786c0e73097fe7e729
1 parent
cf11c052
判断变量输入不合法
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
apps/product/controllers/list.js
apps/product/controllers/list.js
View file @
2b8422e
...
...
@@ -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
=
{
...
...
Please
register
or
login
to post a comment