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
afc01282
authored
Mar 11, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
成本价输出
parent
8776b963
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
model/goods.go
model/ly_sku.go
service/service_ly_common.go
service/service_price.go
model/goods.go
View file @
afc01282
...
...
@@ -21,11 +21,12 @@ type LadderPrice struct {
}
type
OriginPrice
struct
{
Purchases
int64
`json:"purchases"`
//购买数量
PriceUs
float64
`json:"price_us"`
//数量对应的英文价格
PriceCn
float64
`json:"price_cn"`
//数量对应的中文价格
PriceAc
float64
`json:"price_ac,omitempty"`
CostPrice
float64
`json:"cost_price"`
Purchases
int64
`json:"purchases"`
//购买数量
PriceUs
float64
`json:"price_us"`
//数量对应的英文价格
PriceCn
float64
`json:"price_cn"`
//数量对应的中文价格
PriceAc
float64
`json:"price_ac,omitempty"`
CostPrice
float64
`json:"cost_price"`
CostPriceUs
float64
`json:"cost_price_us"`
}
type
DatabasePrice
struct
{
...
...
model/ly_sku.go
View file @
afc01282
...
...
@@ -102,7 +102,8 @@ type LySku struct {
OnwayStock
int
`json:"onway_stock"`
CompareRatio
float64
`json:"compare_ratio"`
//兼容自营下单的字段,取成本价的第一个阶梯的人民币
Cost
float64
`json:"cost"`
Cost
float64
`json:"cost"`
CostUs
float64
`json:"cost_us"`
}
type
DiscountRatio
struct
{
...
...
service/service_ly_common.go
View file @
afc01282
...
...
@@ -357,6 +357,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
Purchases
:
price
.
Purchases
,
PriceCn
:
priceCnTax
,
PriceUs
:
price
.
PriceUs
,
CostPrice
:
price
.
CostPrice
,
})
}
...
...
service/service_price.go
View file @
afc01282
...
...
@@ -956,6 +956,7 @@ func (ps *PriceService) GetComparePrice(sku model.LySku) model.LySku {
func
(
ps
*
PriceService
)
GetCostForZiying
(
sku
model
.
LySku
)
model
.
LySku
{
if
len
(
sku
.
OriginalPrice
)
!=
0
{
sku
.
Cost
=
sku
.
OriginalPrice
[
0
]
.
CostPrice
sku
.
CostUs
=
sku
.
OriginalPrice
[
0
]
.
CostPriceUs
}
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