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
f10efb25
authored
Dec 04, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into dev
parents
404a6d24
b317e448
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
7 deletions
model/ly_sku.go
service/service_ly.go
service/service_ly_common.go
service/service_zy.go
model/ly_sku.go
View file @
f10efb25
...
...
@@ -86,6 +86,7 @@ type LySku struct {
OriginCurrencySymbol
string
`json:"origin_currency_symbol,omitempty"`
CustomizeRateRMB
float64
CustomizeRateUs
float64
SpuEccn
string
`json:"spu_eccn"`
}
type
DiscountRatio
struct
{
...
...
@@ -148,6 +149,7 @@ type SpuExtra struct {
Name
string
`bson:"name" json:"name"`
Thumbnail
string
`bson:"thumbnail" json:"thumbnail"`
}
`bson:"image_list" json:"image_list"`
SpuDetail
string
`bson:"spu_detail" json:"spu_detail"`
SpuId
string
`bson:"spu_id" json:"spu_id"`
EnPdfUrl
string
`bson:"en_pdf_url" json:"en_pdf_url"`
...
...
service/service_ly.go
View file @
f10efb25
...
...
@@ -289,5 +289,31 @@ func (ls *LyService) GetSpuExtra(spuId string) (spuExtra model.SpuExtra) {
if
err
!=
nil
&&
err
!=
mgo
.
ErrNotFound
{
logger
.
Select
(
"sku_query"
)
.
Error
(
err
.
Error
())
}
//兼容老版本数据
if
len
(
spuExtra
.
ImageList
)
==
0
{
type
OldSpuExtra
struct
{
OldImageList
map
[
string
]
struct
{
Name
string
`bson:"name"`
Thumbnail
string
`bson:"thumbnail"`
}
`bson:"image_list" json:"old_image_list"`
}
var
oldSpuExtra
OldSpuExtra
err
=
mongodb
.
DB
(
"ichunt"
)
.
C
(
"spu_extra"
)
.
Find
(
bson
.
M
{
"spu_id"
:
spuId
})
.
One
(
&
oldSpuExtra
)
for
_
,
image
:=
range
oldSpuExtra
.
OldImageList
{
spuExtra
.
ImageList
=
append
(
spuExtra
.
ImageList
,
struct
{
Name
string
`bson:"name" json:"name"`
Thumbnail
string
`bson:"thumbnail" json:"thumbnail"`
}{
Name
:
image
.
Name
,
Thumbnail
:
image
.
Thumbnail
,
})
}
}
return
spuExtra
}
service/service_ly_common.go
View file @
f10efb25
...
...
@@ -262,6 +262,7 @@ func (ls *LyService) CombineSup(sku model.LySku, spuStr string) model.LySku {
sku
.
SpuDetail
=
gjson
.
Get
(
spuStr
,
"spu_detail"
)
.
String
()
sku
.
Status
=
int
(
gjson
.
Get
(
spuStr
,
"status"
)
.
Int
())
sku
.
Encap
=
gjson
.
Get
(
spuStr
,
"encap"
)
.
String
()
sku
.
SpuEccn
=
gjson
.
Get
(
spuStr
,
"eccn"
)
.
String
()
return
sku
}
...
...
service/service_zy.go
View file @
f10efb25
...
...
@@ -17,7 +17,8 @@ type ZiyingService struct {
}
/*
自营数据详情
自营数据详情
查询商品详情(自营或者联营)
@doc http://192.168.2.232:3000/project/128/interface/api/649
...
...
@@ -169,12 +170,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
A
.
Set
(
"saler_atio"
,
""
)
//
}
if
len
(
attrs
)
==
0
{
A
.
Set
(
"attrs"
,
""
)
//属性值
}
else
{
A
.
Set
(
"attrs"
,
attrs
)
//
}
A
.
Set
(
"attrs"
,
attrs
)
//
A
.
Set
(
"cost"
,
gjson
.
Get
(
info
,
"cost"
)
.
String
())
//
A
.
Set
(
"new_cost"
,
gjson
.
Get
(
info
,
"new_cost"
)
.
String
())
//
A
.
Set
(
"supplier_stock"
,
gjson
.
Get
(
info
,
"supplier_stock"
)
.
Int
())
//
...
...
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