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
522133f4
Commit
522133f4
authored
Aug 21, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微店首页价格
parent
48388c5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+16
-16
No files found.
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
522133f4
...
@@ -214,9 +214,9 @@ namespace Mall.WebApi.Controllers
...
@@ -214,9 +214,9 @@ namespace Mall.WebApi.Controllers
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
if
(
spList
.
Any
())
{
{
foreach
(
var
qitem
in
sp
rice
List
)
foreach
(
var
qitem
in
spList
)
{
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
if
(
sspModel
!=
null
)
{
{
//单商品设置的
//单商品设置的
...
@@ -244,8 +244,8 @@ namespace Mall.WebApi.Controllers
...
@@ -244,8 +244,8 @@ namespace Mall.WebApi.Controllers
}
}
}
}
}
}
item
.
SellingPrice
=
sp
rice
List
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
sp
rice
List
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
item
.
OriginalPrice
=
MaxPrice
;
...
@@ -334,9 +334,9 @@ namespace Mall.WebApi.Controllers
...
@@ -334,9 +334,9 @@ namespace Mall.WebApi.Controllers
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
if
(
spList
.
Any
())
{
{
foreach
(
var
qitem
in
sp
rice
List
)
foreach
(
var
qitem
in
spList
)
{
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
if
(
sspModel
!=
null
)
{
{
//单商品设置的
//单商品设置的
...
@@ -364,8 +364,8 @@ namespace Mall.WebApi.Controllers
...
@@ -364,8 +364,8 @@ namespace Mall.WebApi.Controllers
}
}
}
}
}
}
item
.
SellingPrice
=
sp
rice
List
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
sp
rice
List
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
{
...
@@ -457,9 +457,9 @@ namespace Mall.WebApi.Controllers
...
@@ -457,9 +457,9 @@ namespace Mall.WebApi.Controllers
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
if
(
spList
.
Any
())
{
{
foreach
(
var
qitem
in
sp
rice
List
)
foreach
(
var
qitem
in
spList
)
{
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
if
(
sspModel
!=
null
)
{
{
//单商品设置的
//单商品设置的
...
@@ -487,8 +487,8 @@ namespace Mall.WebApi.Controllers
...
@@ -487,8 +487,8 @@ namespace Mall.WebApi.Controllers
}
}
}
}
}
}
item
.
SellingPrice
=
sp
rice
List
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
sp
rice
List
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
{
...
@@ -577,9 +577,9 @@ namespace Mall.WebApi.Controllers
...
@@ -577,9 +577,9 @@ namespace Mall.WebApi.Controllers
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
if
(
spList
.
Any
())
{
{
foreach
(
var
qitem
in
sp
rice
List
)
foreach
(
var
qitem
in
spList
)
{
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
if
(
sspModel
!=
null
)
{
{
//单商品设置的
//单商品设置的
...
@@ -607,8 +607,8 @@ namespace Mall.WebApi.Controllers
...
@@ -607,8 +607,8 @@ namespace Mall.WebApi.Controllers
}
}
}
}
}
}
item
.
SellingPrice
=
sp
rice
List
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
sp
rice
List
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
{
...
...
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