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
87f6ad82
Commit
87f6ad82
authored
Jul 24, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
7be93414
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+30
-3
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+1
-1
No files found.
Mall.Module.Product/ProductModule.cs
View file @
87f6ad82
...
...
@@ -1467,7 +1467,15 @@ namespace Mall.Module.Product
{
if
(
model
.
SpecificationPriceList
.
Any
()
&&
model
.
SpecificationList
.
Any
())
{
foreach
(
var
item
in
model
.
SpecificationPriceList
)
List
<
RB_Goods_Specification_Extend
>
SpecificationListToPrice
=
new
List
<
RB_Goods_Specification_Extend
>();
List
<
RB_Goods_SpecificationValue_Extend
>
SpecificationValueListToPrice
=
new
List
<
RB_Goods_SpecificationValue_Extend
>();
bool
IsHaveSellingPriceZero
=
false
;
if
(
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Count
()
!=
model
.
SpecificationPriceList
.
Count
())
{
//有数量为0的
IsHaveSellingPriceZero
=
true
;
}
foreach
(
var
item
in
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
))
{
var
ssarr
=
item
.
SpecificationSort
.
Split
(
':'
);
int
Sort
=
Convert
.
ToInt32
(
ssarr
[
0
]);
...
...
@@ -1476,7 +1484,15 @@ namespace Mall.Module.Product
for
(
int
i
=
0
;
i
<
ssarr
.
Length
;
i
++)
{
var
smodel
=
model
.
SpecificationList
[
i
];
if
(
IsHaveSellingPriceZero
&&
!
SpecificationListToPrice
.
Where
(
x
=>
x
.
Id
==
smodel
.
Id
).
Any
())
{
SpecificationListToPrice
.
Add
(
smodel
);
}
var
svmodel
=
smodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Convert
.
ToInt32
(
ssarr
[
i
])).
FirstOrDefault
();
if
(
IsHaveSellingPriceZero
&&
!
SpecificationValueListToPrice
.
Where
(
x
=>
x
.
Id
==
svmodel
.
Id
).
Any
())
{
SpecificationValueListToPrice
.
Add
(
svmodel
);
}
attr_list
.
Add
(
new
{
attr_group_name
=
smodel
.
Name
,
...
...
@@ -1549,6 +1565,17 @@ namespace Mall.Module.Product
member_price_list
});
}
//当只有一组规格项目时
if
(
IsHaveSellingPriceZero
&&
SpecificationListToPrice
.
Any
()
&&
model
.
SpecificationList
.
Count
()
==
1
)
{
foreach
(
var
item
in
SpecificationListToPrice
)
{
item
.
SpecificationValueList
=
SpecificationValueListToPrice
.
Where
(
x
=>
x
.
SpecificationId
==
item
.
Id
).
OrderBy
(
x
=>
x
.
Sort
).
ToList
();
}
SpecificationListToPrice
=
SpecificationListToPrice
.
Where
(
x
=>
x
.
SpecificationValueList
.
Any
()).
ToList
();
//有价格小于等于0的 在前端展示时 需屏蔽掉
model
.
SpecificationList
=
SpecificationListToPrice
;
}
}
}
else
...
...
@@ -1672,8 +1699,8 @@ namespace Mall.Module.Product
if
(
model
.
IsCustomSpecification
==
1
)
{
price_member_min
=
price_min
=
model
.
SpecificationPriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
price_member_max
=
price_max
=
model
.
SpecificationPriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
price_member_min
=
price_min
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Min
(
x
=>
x
.
SellingPrice
??
0
);
price_member_max
=
price_max
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Max
(
x
=>
x
.
SellingPrice
??
0
);
}
else
{
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
87f6ad82
...
...
@@ -1665,7 +1665,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
InventoryNum
+=
(
pricemodel
.
InventoryNum
??
0
);
}
//主表价格 如果有自定义规格,直接取最小值
demodel
.
SellingPrice
=
demodel
.
SpecificationPriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
)
;
demodel
.
SellingPrice
=
demodel
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
)?.
Min
(
x
=>
x
.
SellingPrice
??
0
)
??
0
;
//分销佣金
if
(
demodel
.
SeparateDistribution
==
1
)
{
...
...
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