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
d689bf08
authored
Dec 10, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
获取成本价给自营订单
parent
a4072b89
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletions
model/ly_sku.go
service/service_ly.go
service/service_price.go
model/ly_sku.go
View file @
d689bf08
...
...
@@ -95,6 +95,8 @@ type LySku struct {
BrandPack
string
`json:"brand_pack"`
OnwayStock
int
`json:"onway_stock"`
CompareRatio
float64
`json:"compare_ratio"`
//兼容自营下单的字段,取成本价的第一个阶梯的人民币
Cost
float64
`json:"cost"`
}
type
DiscountRatio
struct
{
...
...
service/service_ly.go
View file @
d689bf08
...
...
@@ -267,6 +267,8 @@ func (ls *LyService) LyGoodsDetail(ctx context.Context, params RequestParams, go
// sku = priceService.GetComparePrice(sku)
sku
=
priceService
.
GetCostForZiying
(
sku
)
//仅提供价格和库存
if
fast
!=
"1"
{
if
sku
.
SupplierId
!=
0
{
...
...
service/service_price.go
View file @
d689bf08
...
...
@@ -921,7 +921,7 @@ func (ps *PriceService) GetActivityPrice(sku model.LySku) model.LySku {
}
// compare_price_ratio
func
(
ps
*
PriceService
)
GetCompar
1
ePrice
(
sku
model
.
LySku
)
model
.
LySku
{
func
(
ps
*
PriceService
)
GetComparePrice
(
sku
model
.
LySku
)
model
.
LySku
{
redisCon
:=
gredis
.
Conn
(
"default_r"
)
//判断是否存在
compareData
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"compare_price_ratio"
,
sku
.
GoodsId
))
...
...
@@ -945,3 +945,12 @@ func (ps *PriceService) GetCompar1ePrice(sku model.LySku) model.LySku {
sku
.
LadderPriceResult
=
sku
.
LadderPrice
return
sku
}
// 获取自营成本价
func
(
ps
*
PriceService
)
GetCostForZiying
(
sku
model
.
LySku
)
model
.
LySku
{
if
len
(
sku
.
OriginalPrice
)
!=
0
{
sku
.
Cost
=
sku
.
OriginalPrice
[
0
]
.
PriceCn
}
return
sku
}
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