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
14a15218
Commit
14a15218
authored
Aug 06, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
238cb0f7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
41 deletions
+95
-41
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+40
-1
AppletGoodsController.cs
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
+55
-40
No files found.
Mall.Module.Product/ProductModule.cs
View file @
14a15218
...
...
@@ -246,6 +246,17 @@ namespace Mall.Module.Product
}
string
goodsIds2
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
List
<
RB_Goods_Order_Extend
>
orderlist
=
goods_OrderRepository
.
GetGoodsOrderNum
(
goodsIds
:
goodsIds2
);
//2020-08-06 Add by:W 查询商品分类获取分类包邮规则
string
allGoodsIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
goodsCategoryList
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsIds
=
allGoodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
string
categoryIds
=
string
.
Join
(
","
,
goodsCategoryList
.
Select
(
x
=>
x
.
CategoryId
).
Distinct
());
List
<
RB_FreeShipping_Extend
>
freeShippingList
=
new
List
<
RB_FreeShipping_Extend
>();
if
(!
string
.
IsNullOrWhiteSpace
(
categoryIds
))
{
freeShippingList
=
freeShippingRepository
.
GetFreeShippingListByCategoryIds
(
new
RB_FreeShipping_Extend
{
MallBaseId
=
demodel
.
MallBaseId
,
TenantId
=
demodel
.
TenantId
,
CategoryIds
=
categoryIds
});
}
//2020-08-06 Add by:W End
foreach
(
var
item
in
list
)
{
item
.
CoverImage
=
""
;
...
...
@@ -269,7 +280,35 @@ namespace Mall.Module.Product
}
item
.
SalesNum
+=
(
orderlist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
);
//2020-08-06 Add by:W 查询商品分类获取分类包邮规则
if
(
freeShippingList
!=
null
&&
freeShippingList
.
Any
())
{
var
nowcategory
=
goodsCategoryList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
Select
(
x
=>
x
.
CategoryId
);
var
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
nowcategory
.
Contains
(
x
.
CategoryId
)
&&
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullNumPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullNumPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
{
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
nowcategory
.
Contains
(
x
.
CategoryId
)
&&
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullMoneyPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullMoneyPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
}
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
{
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
nowcategory
.
Contains
(
x
.
CategoryId
)
&&
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullNumPinkage
>
0
&&
x
.
CategoryId
==
0
).
OrderBy
(
x
=>
x
.
FullNumPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
}
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
{
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
nowcategory
.
Contains
(
x
.
CategoryId
)
&&
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullMoneyPinkage
>
0
&&
x
.
CategoryId
==
0
).
OrderBy
(
x
=>
x
.
FullMoneyPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
}
item
.
FreeShippingModel
=
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
?
new
RB_FreeShipping_Extend
()
:
fullNumPinkageModel
;
}
else
{
item
.
FreeShippingModel
=
new
RB_FreeShipping_Extend
();
}
//2020-08-06 Add by:W End
}
}
return
list
;
}
...
...
@@ -1059,7 +1098,7 @@ namespace Mall.Module.Product
var
freeShippingList
=
freeShippingRepository
.
GetFreeShippingListByCategoryIds
(
new
RB_FreeShipping_Extend
{
MallBaseId
=
model
.
MallBaseId
,
TenantId
=
model
.
TenantId
,
CategoryIds
=
categoryIds
});
if
(
freeShippingList
!=
null
&&
freeShippingList
.
Any
())
{
var
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullNumPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullNumPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
var
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullNumPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullNumPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
{
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullMoneyPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullMoneyPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
...
...
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
View file @
14a15218
This diff is collapsed.
Click to expand it.
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