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
db241bc8
Commit
db241bc8
authored
Aug 21, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
e8e6b2f1
f6320b7e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
315 additions
and
71 deletions
+315
-71
RB_Share_Friend.cs
Mall.Model/Entity/MarketingCenter/RB_Share_Friend.cs
+5
-0
ShareModule.cs
Mall.Module.MarketingCenter/ShareModule.cs
+10
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+5
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+5
-0
RB_Share_FriendRepository.cs
Mall.Repository/MarketingCenter/RB_Share_FriendRepository.cs
+19
-3
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+254
-67
ShareController.cs
Mall.WebApi/Controllers/MarketingCenter/ShareController.cs
+17
-1
No files found.
Mall.Model/Entity/MarketingCenter/RB_Share_Friend.cs
View file @
db241bc8
...
...
@@ -97,5 +97,10 @@ namespace Mall.Model.Entity.MarketingCenter
/// 更新时间
/// </summary>
public
DateTime
UpdateDate
{
get
;
set
;
}
/// <summary>
/// 分享数量
/// </summary>
public
int
ShareCount
{
get
;
set
;
}
}
}
Mall.Module.MarketingCenter/ShareModule.cs
View file @
db241bc8
...
...
@@ -348,5 +348,15 @@ namespace Mall.Module.MarketingCenter
flag
=
share_FriendRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Share_Friend_Extend
.
Id
),
Id
));
return
flag
;
}
/// <summary>
/// 更新分享数量
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
SetShareFrendShareCountModule
(
object
Id
)
{
return
share_FriendRepository
.
SetShareFrendShareCountRepository
(
Id
);
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
db241bc8
...
...
@@ -2689,6 +2689,11 @@ namespace Mall.Module.Product
}
}
}
if
(
dcList
.
Where
(
x
=>
x
.
SmallShopId
>
0
).
Any
())
{
IsCommissionCoupons
=
false
;
}
}
}
}
...
...
Mall.Module.Product/ProductModule.cs
View file @
db241bc8
...
...
@@ -1489,6 +1489,11 @@ namespace Mall.Module.Product
}
MaxSellMoney
=
model
.
SpecificationPriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
model
.
SellingPrice
=
model
.
SpecificationPriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
MaxSellMoney
+
Math
.
Ceiling
(
MaxSellMoney
/
10
);
if
(
MaxPrice
>
model
.
OriginalPrice
)
{
model
.
OriginalPrice
=
MaxPrice
;
}
}
//区域
model
.
AreaList
=
new
List
<
RB_Goods_Area_Extend
>();
...
...
Mall.Repository/MarketingCenter/RB_Share_FriendRepository.cs
View file @
db241bc8
...
...
@@ -22,7 +22,7 @@ namespace Mall.Repository.MarketingCenter
/// <param name="query">查询条件</param>
/// <param name="IsUse">true-只查询启用的</param>
/// <returns></returns>
public
List
<
RB_Share_Friend_Extend
>
GetShareFriendPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Share_Friend_Extend
query
,
bool
IsUse
=
false
)
public
List
<
RB_Share_Friend_Extend
>
GetShareFriendPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Share_Friend_Extend
query
,
bool
IsUse
=
false
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
...
...
@@ -46,7 +46,7 @@ WHERE 1=1 AND A.Status=0
}
if
(
query
.
CateId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Share_Friend_Extend
.
CateId
),
query
.
CateId
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Share_Friend_Extend
.
CateId
),
query
.
CateId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CateIds
))
{
...
...
@@ -192,7 +192,7 @@ WHERE 1=1 AND A.Status=0
dynamicParameters
.
Add
(
"UpdateBy"
,
extModel
.
UpdateBy
);
dynamicParameters
.
Add
(
"UpdateDate"
,
extModel
.
UpdateDate
);
dynamicParameters
.
Add
(
"Id"
,
extModel
.
Id
);
flag
=
base
.
Execute
(
builder
.
ToString
(),
dynamicParameters
)
>
0
;
flag
=
base
.
Execute
(
builder
.
ToString
(),
dynamicParameters
)
>
0
;
}
else
{
...
...
@@ -218,5 +218,21 @@ WHERE 1=1 AND A.Status=0
}
return
flag
;
}
/// <summary>
/// 更新分享数量
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
SetShareFrendShareCountRepository
(
object
Id
)
{
bool
flag
=
false
;
DynamicParameters
dynamicParameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@" UPDATE rb_share_friend SET shareCount=shareCount+1 WHERE Id=@Id "
);
dynamicParameters
.
Add
(
"Id"
,
Id
);
flag
=
base
.
Execute
(
builder
.
ToString
(),
dynamicParameters
)
>
0
;
return
flag
;
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
db241bc8
...
...
@@ -3,11 +3,13 @@ using Mall.Model.Entity.BaseSetUp;
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Extend.BaseSetUp
;
using
Mall.Model.Extend.MarketingCenter
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.User
;
using
Mall.Module.BaseSetUp
;
using
Mall.Module.MarketingCenter
;
using
Mall.Module.Product
;
using
Mall.Module.User
;
using
Mall.Repository.Product
;
using
Mall.Repository.User
;
using
Newtonsoft.Json
;
using
System
;
...
...
@@ -70,6 +72,10 @@ namespace Mall.WebApi.Controllers
/// 微店商品价格
/// </summary>
private
static
RB_SmallShops_PriceRepository
smallShops_PriceRepository
=
new
RB_SmallShops_PriceRepository
();
/// <summary>
/// 商品规格价格
/// </summary>
private
static
RB_Goods_SpecificationPriceRepository
goods_SpecificationPriceRepository
=
new
RB_Goods_SpecificationPriceRepository
();
/// <summary>
...
...
@@ -195,41 +201,87 @@ namespace Mall.WebApi.Controllers
#
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
())
{
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
});
foreach
(
var
item
in
tempGoodsList
)
{
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
s
spModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefaul
t
();
if
(
s
spModel
!=
null
)
var
s
pList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToLis
t
();
if
(
s
pList
.
Any
()
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
foreach
(
var
qitem
in
spriceList
)
{
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
);
var
sspModel
=
smallPList
.
Where
(
x
=>
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
);
}
}
}
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
SellingPrice
=
spriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
if
(
smallModel
.
PriceType
==
1
)
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
s
mall
Model
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
s
mall
Model
.
UpPrice
??
0
)
/
100
);
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
s
sp
Model
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
s
sp
Model
.
UpPrice
??
0
)
/
100
);
}
else
if
(
s
mall
Model
.
PriceType
==
2
)
else
if
(
s
sp
Model
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
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
);
}
}
}
}
...
...
@@ -274,38 +326,83 @@ namespace Mall.WebApi.Controllers
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
s
spModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefaul
t
();
if
(
s
spModel
!=
null
)
var
s
pList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToLis
t
();
if
(
s
pList
.
Any
()
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
foreach
(
var
qitem
in
spriceList
)
{
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
);
var
sspModel
=
smallPList
.
Where
(
x
=>
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
);
}
}
}
}
else
if
(
sspModel
.
PriceType
==
2
)
item
.
SellingPrice
=
spriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
if
(
smallModel
.
PriceType
==
1
)
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
s
mall
Model
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
s
mall
Model
.
UpPrice
??
0
)
/
100
);
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
s
sp
Model
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
s
sp
Model
.
UpPrice
??
0
)
/
100
);
}
else
if
(
s
mall
Model
.
PriceType
==
2
)
else
if
(
s
sp
Model
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
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
);
}
}
}
}
...
...
@@ -352,38 +449,83 @@ namespace Mall.WebApi.Controllers
string
goodsId
=
string
.
Join
(
","
,
goodsList
.
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
goodsList
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
s
spModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefaul
t
();
if
(
s
spModel
!=
null
)
var
s
pList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToLis
t
();
if
(
s
pList
.
Any
()
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
foreach
(
var
qitem
in
spriceList
)
{
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
);
var
sspModel
=
smallPList
.
Where
(
x
=>
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
);
}
}
}
}
else
if
(
sspModel
.
PriceType
==
2
)
item
.
SellingPrice
=
spriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
if
(
smallModel
.
PriceType
==
1
)
//单商品设置的
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
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
10
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
10
0
);
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
else
if
(
smallModel
.
PriceType
==
2
)
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
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
);
}
}
}
}
...
...
@@ -427,38 +569,83 @@ namespace Mall.WebApi.Controllers
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
s
spModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefaul
t
();
if
(
s
spModel
!=
null
)
var
s
pList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToLis
t
();
if
(
s
pList
.
Any
()
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
foreach
(
var
qitem
in
spriceList
)
{
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
);
var
sspModel
=
smallPList
.
Where
(
x
=>
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
);
}
}
}
}
else
if
(
sspModel
.
PriceType
==
2
)
item
.
SellingPrice
=
spriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
if
(
smallModel
.
PriceType
==
1
)
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
s
mall
Model
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
s
mall
Model
.
UpPrice
??
0
)
/
100
);
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
s
sp
Model
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
s
sp
Model
.
UpPrice
??
0
)
/
100
);
}
else
if
(
s
mall
Model
.
PriceType
==
2
)
else
if
(
s
sp
Model
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
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
);
}
}
}
}
...
...
Mall.WebApi/Controllers/MarketingCenter/ShareController.cs
View file @
db241bc8
...
...
@@ -157,11 +157,14 @@ namespace Mall.WebApi.Controllers.MarketingCenter
qitem
.
ImgList
,
qitem
.
CoverImg
,
qitem
.
LinkUrl
,
qitem
.
CreateDateStr
qitem
.
CreateDateStr
,
qitem
.
ShareCount
,
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取分享详情列表
/// </summary>
...
...
@@ -273,5 +276,18 @@ namespace Mall.WebApi.Controllers.MarketingCenter
bool
flag
=
shareModule
.
SetShareFriendMaterialInfoModule
(
Id
,
MaterialInfo
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 更新分享数量
/// </summary>
/// <returns></returns>
[
AllowAnonymous
]
public
ApiResult
SetShareCount
()
{
JObject
parm
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
Id
=
parm
.
GetInt
(
"Id"
,
0
);
bool
flag
=
shareModule
.
SetShareFrendShareCountModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
}
\ No newline at end of file
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