Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
yyq
7 years ago
Commit
47db73444b01b86bb2693a23c13877899ba6a510
2 parents
0212fe80
6e165909
Merge branch 'release/6.1' of git.yoho.cn:fe/yohobuy-node into release/6.1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
apps/activity/models/coupon.js
apps/activity/models/coupon.js
View file @
47db734
...
...
@@ -83,7 +83,7 @@ exports.getCouponData = (channel, params) => {
exports
.
getCouponStatus
=
(
params
)
=>
{
return
Promise
.
coroutine
(
function
*
()
{
const
coupon
=
yield
api
.
get
(
''
,
Object
.
assign
(
params
,
{
method
:
'app.promotion.
queryCouponCenter
'
method
:
'app.promotion.
couponStatus
'
}));
const
result
=
{
code
:
coupon
.
code
,
...
...
@@ -95,26 +95,21 @@ exports.getCouponStatus = (params) => {
break
;
}
coupon
.
data
.
forEach
(
function
(
val
)
{
if
(
val
.
template_name
===
'getCoupon'
&&
val
.
data
.
length
)
{
// 优惠券楼层
val
.
data
.
forEach
(
function
(
item
)
{
const
status
=
Number
(
item
.
status
);
coupon
.
data
.
forEach
(
function
(
item
)
{
const
status
=
Number
(
item
.
status
);
if
([
2
,
3
].
indexOf
(
status
)
>
-
1
)
{
const
cou
=
{
id
:
crypto
.
encryption
(
'yoho9646abcdefgh'
,
item
.
couponID
)
// 加密优惠券号
};
if
([
2
,
3
].
indexOf
(
status
)
>
-
1
)
{
const
cou
=
{
id
:
crypto
.
encryption
(
'yoho9646abcdefgh'
,
item
.
couponId
)
// 加密优惠券号
};
if
(
status
===
2
)
{
cou
.
empty
=
true
;
// 优惠券已抢光
}
else
if
(
status
===
3
)
{
cou
.
got
=
true
;
// 优惠券已领取
}
if
(
status
===
2
)
{
cou
.
empty
=
true
;
// 优惠券已抢光
}
else
if
(
status
===
3
)
{
cou
.
got
=
true
;
// 优惠券已领取
}
result
.
categories
.
push
(
cou
);
}
});
result
.
categories
.
push
(
cou
);
}
});
}
...
...
Please
register
or
login
to post a comment