Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
ad128854
Commit
ad128854
authored
Aug 07, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动发放优惠券
parent
8cf6d0b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
CouponModule.cs
Mall.Module.MarketingCenter/CouponModule.cs
+2
-2
No files found.
Mall.Module.MarketingCenter/CouponModule.cs
View file @
ad128854
...
...
@@ -896,12 +896,12 @@ namespace Mall.Module.MarketingCenter
}
//根据发放类型获取对应的优惠券信息
var
couponList
=
discountCouponRepository
.
GetSelfmotionCouponList
(
model
);
if
(
couponList
!=
null
&&
couponList
.
Any
(
x
=>
x
.
TotalNum
==
-
1
||
((
x
.
TotalNum
-
x
.
ReceiveNum
)
>
0
)
))
//存在满足条件的优惠券可以发放
if
(
couponList
!=
null
&&
couponList
.
Any
(
x
=>
x
.
TotalNum
==
-
1
||
x
.
TotalNum
>
0
))
//存在满足条件的优惠券可以发放
{
bool
isReceive
=
false
;
//查询已发放的优惠券信息
var
memberCouponList
=
memberCouponRepository
.
GetAutoMemberCouponPageList
(
new
RB_Member_DiscountCoupon_Extend
{
UserId
=
model
.
UserId
,
GetType
=
model
.
TriggerType
,
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
});
foreach
(
var
item
in
couponList
.
Where
(
x
=>
x
.
TotalNum
==
-
1
||
((
x
.
TotalNum
-
x
.
ReceiveNum
)
>
0
)
))
//判断当前优惠券是否已超过领取数
foreach
(
var
item
in
couponList
.
Where
(
x
=>
x
.
TotalNum
==
-
1
||
x
.
TotalNum
>
0
))
//判断当前优惠券是否已超过领取数
{
int
membercouponCoun
=
memberCouponList
.
Where
(
x
=>
x
.
CouponId
==
item
.
ID
).
Count
();
if
(!
isReceive
&&
membercouponCoun
<
item
.
GrantNum
)
//此次没有领取,并且当前优惠券没有超过领取数量
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment