Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6209d9c3
authored
Mar 11, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复
parent
653c7074
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
service/service_custom_price.go
service/service_ly_common.go
service/service_price.go
service/service_custom_price.go
View file @
6209d9c3
...
...
@@ -26,13 +26,13 @@ func (sc *CustomPrice) getCustomPriceList(sku model.LySku) (customPriceList []mo
var
customPrice
model
.
CustomPrice
customPrice
.
PriceName
=
priceName
for
_
,
item
:=
range
sku
.
LadderPrice
{
ratioFloat
:=
c
.
DivFloat
(
float64
(
100
+
ratio
)
,
100
)
ratioFloat
:=
c
.
DivFloat
(
float64
(
100
+
ratio
)
,
100
)
customPrice
.
LadderPrice
=
append
(
customPrice
.
LadderPrice
,
model
.
LadderPrice
{
Purchases
:
item
.
Purchases
,
PriceCn
:
c
.
MyRound
(
c
.
MulFloat
(
item
.
PriceCn
*
ratioFloat
),
2
),
PriceUs
:
c
.
MyRound
(
c
.
MulFloat
(
item
.
PriceUs
*
ratioFloat
),
2
),
PriceAc
:
c
.
MyRound
(
c
.
MulFloat
(
item
.
PriceAc
*
ratioFloat
),
2
),
PriceAcUs
:
c
.
MyRound
(
c
.
MulFloat
(
item
.
PriceAcUs
*
ratioFloat
),
2
),
PriceCn
:
c
.
MyRound
(
c
.
MulFloat
(
item
.
PriceCn
*
ratioFloat
),
2
),
PriceUs
:
c
.
MyRound
(
c
.
MulFloat
(
item
.
PriceUs
*
ratioFloat
),
2
),
PriceAc
:
c
.
MyRound
(
c
.
MulFloat
(
item
.
PriceAc
*
ratioFloat
),
2
),
PriceAcUs
:
c
.
MyRound
(
c
.
MulFloat
(
item
.
PriceAcUs
*
ratioFloat
),
2
),
})
}
customPriceList
=
append
(
customPriceList
,
customPrice
)
...
...
@@ -59,11 +59,12 @@ func (sc *CustomPrice) transformIEdgeLadderPrice(sku model.LySku) (ladderPriceLi
]
*/
if
len
(
sku
.
CustomPriceList
)
!=
0
{
for
_
,
customPrice
:=
range
sku
.
CustomPriceList
{
if
len
(
customPrice
.
LadderPrice
)
>
0
{
//只取
第
一个元素价格就行
ladderPrice
:=
customPrice
.
LadderPrice
[
0
]
for
index
,
customPrice
:=
range
sku
.
CustomPriceList
{
if
len
(
customPrice
.
LadderPrice
)
>
0
{
//只取
最后
一个元素价格就行
ladderPrice
:=
customPrice
.
LadderPrice
[
len
(
customPrice
.
LadderPrice
)
-
1
]
ladderPrice
.
PriceName
=
customPrice
.
PriceName
ladderPrice
.
Purchases
=
int64
(
index
+
1
)
ladderPriceList
=
append
(
ladderPriceList
,
ladderPrice
)
}
...
...
service/service_ly_common.go
View file @
6209d9c3
...
...
@@ -293,13 +293,11 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//sku.Original = nil
return
sku
}
priceService
:=
PriceService
{}
flag
:=
0
var
data
[]
model
.
LadderPrice
var
originalPrice
[]
model
.
OriginPrice
sort
.
Sort
(
sorter
.
OriginPriceSorter
(
sku
.
OriginalPrice
))
//专卖价格获取
if
sku
.
SupplierId
==
17
{
ladderPrice
:=
sku
.
LadderPrice
...
...
@@ -313,7 +311,6 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
ladderPrice
=
sku
.
LadderPrice
}
}
//获取折扣系数
sku
=
priceService
.
GetDiscountRatio
(
sku
)
data
=
make
([]
model
.
LadderPrice
,
len
(
ladderPrice
))
...
...
service/service_price.go
View file @
6209d9c3
...
...
@@ -81,7 +81,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
priceRatio
.
Purchases
=
gjson
.
Get
(
value
.
String
(),
"purchases"
)
.
Int
()
priceRatioList
=
append
(
priceRatioList
,
priceRatio
)
}
//是否满足特定条件的判断
var
hasSpecialCheck
=
false
//判断是否有符合的商品名称
...
...
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