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
38130ae7
Commit
38130ae7
authored
Aug 27, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
排序修改
parent
fd17b763
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+11
-5
No files found.
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
38130ae7
...
@@ -436,12 +436,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
...
@@ -436,12 +436,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
//销量高=>低【降序】
//销量高=>低【降序】
else
if
(
dmodel
.
OrderBy
==
4
)
else
if
(
dmodel
.
OrderBy
==
4
)
{
{
orderBy
=
$" order by
g.
{
nameof
(
RB_Goods_Extend
.
SalesNum
)}
DESC "
;
orderBy
=
$" order by
(g.SalesNum+IFNULL(tempOrder.OrderNum,0))
DESC "
;
}
}
//销量低=>高【升序】
//销量低=>高【升序】
else
if
(
dmodel
.
OrderBy
==
6
)
else
if
(
dmodel
.
OrderBy
==
6
)
{
{
orderBy
=
$" order by
g.
{
nameof
(
RB_Goods_Extend
.
SalesNum
)}
ASC "
;
orderBy
=
$" order by
(g.SalesNum+IFNULL(tempOrder.OrderNum,0))
ASC "
;
}
}
//综合【降序】
//综合【降序】
else
if
(
dmodel
.
OrderBy
==
7
)
else
if
(
dmodel
.
OrderBy
==
7
)
...
@@ -467,9 +467,15 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
...
@@ -467,9 +467,15 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
}
}
}
}
string
sql
=
$@"select g.* from RB_Goods g
string
sql
=
$@"
inner join rb_goods_category c on g.Id=c.GoodsId
SELECT g.*
where
{
where
}
group by g.Id
{
orderBy
}
"
;
FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId
LEFT JOIN (
SELECT od.GoodsId ,SUM(od.Number) as OrderNum FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE 1=1 and o.`Status`=0 and o.OrderStatus <> 7 group by od.GoodsId
) AS tempOrder ON g.Id=tempOrder.GoodsId
WHERE
{
where
}
group by g.Id
{
orderBy
}
"
;
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
...
...
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