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
4e9a5c82
Commit
4e9a5c82
authored
Sep 02, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
80ae4327
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
219 additions
and
191 deletions
+219
-191
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+5
-0
RB_ImageCommonModel.cs
Mall.Model/Extend/Product/RB_ImageCommonModel.cs
+5
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+201
-6
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+5
-0
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+3
-185
No files found.
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
4e9a5c82
...
...
@@ -201,5 +201,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
List
<
object
>
SupplierSpecificationList
{
get
;
set
;
}
/// <summary>
/// 是否直查询有视频商品(1-是)HK0902新增
/// </summary>
public
int
IsVideo
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_ImageCommonModel.cs
View file @
4e9a5c82
...
...
@@ -24,5 +24,10 @@ namespace Mall.Model.Extend.Product
/// 路径
/// </summary>
public
string
Path
{
get
;
set
;
}
/// <summary>
/// 1-视频
/// </summary>
public
int
Type
{
get
;
set
;
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
4e9a5c82
...
...
@@ -1572,6 +1572,16 @@ namespace Mall.Module.Product
//轮播
model
.
CarouselImageList
=
new
List
<
RB_ImageCommonModel
>();
if
(!
string
.
IsNullOrWhiteSpace
(
model
.
VideoAddress
))
{
model
.
CarouselImageList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
0
,
Name
=
""
,
Type
=
1
,
Path
=
model
.
VideoAddress
});
}
if
(!
string
.
IsNullOrEmpty
(
model
.
CarouselImage
)
&&
model
.
CarouselImage
!=
"[]"
)
{
List
<
string
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
CarouselImage
);
...
...
@@ -2370,7 +2380,8 @@ namespace Mall.Module.Product
pic_url
=
model
.
CarouselImageList
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
pic_url
=
x
.
Path
pic_url
=
x
.
Path
,
type
=
x
.
Type
}),
share
=
model
.
MaxShare
,
//分销佣金
myBuyCommission
=
MyBuyCommission
,
//粉象模式 自购返利
...
...
@@ -4020,7 +4031,7 @@ namespace Mall.Module.Product
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetProductGoodsPageList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
)
public
List
<
RB_Goods_Extend
>
GetProductGoodsPageList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
,
int
SmallShopsId
=
0
)
{
if
(!
string
.
IsNullOrEmpty
(
demodel
.
CategoryIds
)
&&
!
demodel
.
CategoryIds
.
Contains
(
','
))
{
...
...
@@ -4050,8 +4061,17 @@ namespace Mall.Module.Product
var
list
=
goodsRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
//查询分类
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
List
<
RB_Goods_SpecificationPrice_Extend
>
spriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
//商品Id
string
ids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
if
(
SmallShopsId
>
0
)
{
smallModel
=
smallShops_InfoRepository
.
GetEntity
<
RB_SmallShops_Info_Extend
>(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsIds
=
ids
});
spriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
ids
});
}
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
)
...
...
@@ -4068,6 +4088,89 @@ namespace Mall.Module.Product
}
item
.
GoodsBuyNum
=
olist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
;
#
region
微店价格
if
(
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
{
foreach
(
var
qitem
in
spList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
#
endregion
}
}
return
list
;
...
...
@@ -4122,13 +4225,22 @@ namespace Mall.Module.Product
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetProductGoodsList
(
RB_Goods_Extend
demodel
)
public
List
<
RB_Goods_Extend
>
GetProductGoodsList
(
RB_Goods_Extend
demodel
,
int
SmallShopsId
=
0
)
{
var
list
=
goodsRepository
.
GetList
(
demodel
);
if
(
list
.
Any
())
{
//查询分类
string
ids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
List
<
RB_Goods_SpecificationPrice_Extend
>
spriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
SmallShopsId
>
0
)
{
smallModel
=
smallShops_InfoRepository
.
GetEntity
<
RB_SmallShops_Info_Extend
>(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsIds
=
ids
});
spriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
ids
});
}
var
clist
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
list
)
{
...
...
@@ -4142,6 +4254,90 @@ namespace Mall.Module.Product
item
.
CoverImage
=
CarouselIdList
[
0
];
//轮播图
}
#
region
微店价格
if
(
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
{
foreach
(
var
qitem
in
spList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
#
endregion
}
}
return
list
;
...
...
@@ -4349,7 +4545,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Goods
.
EnjoyMember
),
demodel
.
EnjoyMember
},
{
nameof
(
RB_Goods
.
SeparateSetMember
),
demodel
.
SeparateSetMember
},
{
nameof
(
RB_Goods
.
IsQuickBuy
),
demodel
.
IsQuickBuy
},
};
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
...
...
@@ -6716,7 +6912,6 @@ namespace Mall.Module.Product
}
#
endregion
#
region
分类包邮规则信息
/// <summary>
/// 物流规则列表
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
4e9a5c82
...
...
@@ -411,6 +411,11 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
if
(
dmodel
.
IsVideo
>
0
)
{
where
+=
$@" and IFNULL(g.
{
nameof
(
RB_Goods_Extend
.
VideoAddress
)}
<>'' "
;
}
//默认综合【升序】
string
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
Sort
)}
asc"
;
//上架时间【降序】
...
...
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
4e9a5c82
...
...
@@ -197,98 +197,8 @@ namespace Mall.WebApi.Controllers
MallBaseId
=
MallBaseId
,
GoodsIds
=
Ids
,
GoodsStatus
=
1
});
#
region
微店价格
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
if
(
SmallShopsId
>
0
&&
tempGoodsList
.
Any
())
{
string
goodsId
=
string
.
Join
(
","
,
tempGoodsList
.
Select
(
x
=>
x
.
Id
));
smallModel
=
smallShops_InfoRepository
.
GetEntity
<
RB_SmallShops_Info_Extend
>(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsIds
=
goodsId
});
var
spriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
goodsId
});
foreach
(
var
item
in
tempGoodsList
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
{
foreach
(
var
qitem
in
spList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
}
#
endregion
},
SmallShopsId
:
SmallShopsId
);
List
<
GoodsDetailsItem2
>
newGoodsList
=
new
List
<
GoodsDetailsItem2
>();
foreach
(
var
goodItem
in
childItem
.
goodsList
)
{
...
...
@@ -317,99 +227,7 @@ namespace Mall.WebApi.Controllers
MallBaseId
=
MallBaseId
,
CategoryIds
=
childItem
.
id
.
ToString
(),
GoodsStatus
=
1
});
#
region
微店价格
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
if
(
SmallShopsId
>
0
&&
catGoodsList
.
Any
())
{
string
goodsId
=
string
.
Join
(
","
,
catGoodsList
.
Select
(
x
=>
x
.
Id
));
smallModel
=
smallShops_InfoRepository
.
GetEntity
<
RB_SmallShops_Info_Extend
>(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsIds
=
goodsId
});
var
spriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
goodsId
});
foreach
(
var
item
in
catGoodsList
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
{
foreach
(
var
qitem
in
spList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
}
#
endregion
},
SmallShopsId
:
SmallShopsId
);
if
(
catGoodsList
!=
null
&&
catGoodsList
.
Count
>
0
)
{
foreach
(
var
gItem
in
catGoodsList
)
...
...
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