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
bdbc7607
Commit
bdbc7607
authored
Jun 16, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单已售数量
parent
8a54e55d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
1 deletion
+9
-1
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+4
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+3
-0
RB_Goods_OrderRepository.cs
Mall.Repository/Product/RB_Goods_OrderRepository.cs
+1
-1
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+1
-0
No files found.
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
bdbc7607
...
...
@@ -22,6 +22,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// 商品购买的数量
/// </summary>
public
int
?
GoodsBuyNum
{
get
;
set
;
}
/// <summary>
/// 视频播放方向 1向下 2向上
/// </summary>
public
int
?
SelectVideoDirection
{
get
;
set
;
}
...
...
Mall.Module.Product/ProductModule.cs
View file @
bdbc7607
...
...
@@ -3166,6 +3166,7 @@ namespace Mall.Module.Product
//查询分类
string
ids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
clist
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
olist
=
goods_OrderRepository
.
GetGoodsOrderNum
(
ids
);
foreach
(
var
item
in
list
)
{
item
.
CategoryList
=
clist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
...
...
@@ -3178,6 +3179,8 @@ namespace Mall.Module.Product
item
.
CoverImage
=
CarouselIdList
[
0
];
//轮播图
}
item
.
GoodsBuyNum
=
olist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
;
}
}
return
list
;
...
...
Mall.Repository/Product/RB_Goods_OrderRepository.cs
View file @
bdbc7607
...
...
@@ -393,7 +393,7 @@ WHERE od.GoodsId={goodsId} and o.`Status`=0 and o.OrderStatus <> 7 GROUP BY o.Us
public
List
<
RB_Goods_Order_Extend
>
GetGoodsOrderNum
(
string
goodsIds
)
{
string
sql2
=
$@"
SELECT od.GoodsId ,SUM(od.Number) as
Goods
Num FROM rb_goods_order o
SELECT od.GoodsId ,SUM(od.Number) as
Order
Num FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE od.GoodsId in(
{
goodsIds
}
) and o.`Status`=0 and o.OrderStatus <> 7 group by od.GoodsId"
;
return
Get
<
RB_Goods_Order_Extend
>(
sql2
).
ToList
();
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
bdbc7607
...
...
@@ -1089,6 +1089,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
SellingPrice
,
x
.
InventoryNum
,
x
.
SalesNum
,
x
.
GoodsBuyNum
,
x
.
IsQuickBuy
,
x
.
GoodsStatus
,
x
.
TenantId
,
...
...
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