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
a2bb5fbd
Commit
a2bb5fbd
authored
Aug 07, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
限购调整
parent
1d18b0c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+24
-0
No files found.
Mall.Module.Product/OrderModule.cs
View file @
a2bb5fbd
...
...
@@ -2459,8 +2459,10 @@ namespace Mall.Module.Product
}
var
OrderGoodsNumList
=
new
List
<
RB_Goods_Order_Extend
>();
bool
IsLimitOk
=
false
;
if
(
gList
.
Where
(
x
=>
x
.
LimitBuyGoodsNum
>
0
).
Any
())
{
IsLimitOk
=
true
;
string
LimitGoodsIds
=
string
.
Join
(
","
,
gList
.
Where
(
x
=>
x
.
LimitBuyGoodsNum
>
0
).
Select
(
x
=>
x
.
Id
));
//查询用户该商品已下单数量
OrderGoodsNumList
=
goods_OrderRepository
.
GetUserOrderGoodsNum
(
demodel
.
UserId
??
0
,
LimitGoodsIds
,
demodel
.
TenantId
,
demodel
.
MallBaseId
);
...
...
@@ -2468,6 +2470,7 @@ namespace Mall.Module.Product
var
OrderNumList
=
new
List
<
RB_Goods_Order_Extend
>();
if
(
gList
.
Where
(
x
=>
x
.
LimitBuyOrderNum
>
0
).
Any
())
{
IsLimitOk
=
true
;
string
LimitGoodsIds
=
string
.
Join
(
","
,
gList
.
Where
(
x
=>
x
.
LimitBuyOrderNum
>
0
).
Select
(
x
=>
x
.
Id
));
//查询用户该商品已下单数量
OrderNumList
=
goods_OrderRepository
.
GetUserOrderNum
(
demodel
.
UserId
??
0
,
LimitGoodsIds
,
demodel
.
TenantId
,
demodel
.
MallBaseId
);
...
...
@@ -2511,6 +2514,27 @@ namespace Mall.Module.Product
#
endregion
}
}
else
if
(
IsLimitOk
)
{
List
<
int
>
GoodsIdList
=
demodel
.
DetailList
.
Select
(
x
=>
x
.
GoodsId
??
0
).
Distinct
().
ToList
();
foreach
(
var
item
in
GoodsIdList
)
{
int
GoodsNum
=
demodel
.
DetailList
.
Where
(
x
=>
x
.
GoodsId
==
item
).
Sum
(
x
=>
x
.
Number
??
0
);
var
gmodel
=
gList
.
Where
(
x
=>
x
.
Id
==
item
).
FirstOrDefault
();
if
(
gmodel
==
null
||
gmodel
.
GoodsStatus
!=
1
)
{
return
ApiResult
.
Failed
(
"有商品不存在或者商品已失效"
);
}
#
region
验证商品限购,订单限购
if
(
gmodel
.
LimitBuyGoodsNum
>
0
)
{
if
(
GoodsNum
>
(
gmodel
.
LimitBuyGoodsNum
??
0
))
{
return
ApiResult
.
Failed
(
"该商品限购"
+
(
gmodel
.
LimitBuyGoodsNum
??
0
)
+
"件"
);
}
}
#
endregion
}
}
List
<
int
>
YFCategoryList
=
new
List
<
int
>();
//全局适配 分类
var
mallbaseModel
=
mallBaseRepository
.
GetListRepository
(
new
Model
.
Extend
.
BaseSetUp
.
RB_MallBase_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
foreach
(
var
item
in
demodel
.
DetailList
)
...
...
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