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
5a0ac286
authored
May 22, 2026
by
hcy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
PhysicalStock
parent
7d8e2ac0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
service/service_ly.go
service/service_ly_common.go
service/service_ly.go
View file @
5a0ac286
...
@@ -340,7 +340,7 @@ func (ls *LyService) LyGoodsDetail(ctx context.Context, params RequestParams, go
...
@@ -340,7 +340,7 @@ func (ls *LyService) LyGoodsDetail(ctx context.Context, params RequestParams, go
sku
.
LadderPriceResult
=
[]
int
{}
sku
.
LadderPriceResult
=
[]
int
{}
}
}
sku
.
Stock
,
sku
.
StockJd
,
sku
=
ls
.
GetStock
(
sku
)
sku
=
ls
.
GetStock
(
sku
)
//判断是否可以购买
//判断是否可以购买
sku
.
IsBuy
=
ls
.
GetIsBuy
(
sku
)
sku
.
IsBuy
=
ls
.
GetIsBuy
(
sku
)
...
...
service/service_ly_common.go
View file @
5a0ac286
...
@@ -276,7 +276,7 @@ func (ls *LyService) GetIsBuy(sku model.LySku) (isBuy int) {
...
@@ -276,7 +276,7 @@ func (ls *LyService) GetIsBuy(sku model.LySku) (isBuy int) {
}
}
// 获取库存
// 获取库存
func
(
ls
*
LyService
)
GetStock
(
sku
model
.
LySku
)
(
s
tock_all
int64
,
jd_stock
int64
,
s
kuResult
model
.
LySku
)
{
func
(
ls
*
LyService
)
GetStock
(
sku
model
.
LySku
)
(
skuResult
model
.
LySku
)
{
//获取新的在途库存信息
//获取新的在途库存信息
sku
.
OnwayStock
=
ls
.
getOnwayStock
(
sku
.
GoodsId
)
sku
.
OnwayStock
=
ls
.
getOnwayStock
(
sku
.
GoodsId
)
...
@@ -316,7 +316,9 @@ func (ls *LyService) GetStock(sku model.LySku) (stock_all int64, jd_stock int64,
...
@@ -316,7 +316,9 @@ func (ls *LyService) GetStock(sku model.LySku) (stock_all int64, jd_stock int64,
jdStockLockStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"sku_lock_stock_jd"
,
sku
.
GoodsId
))
//京东锁库数量
jdStockLockStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"sku_lock_stock_jd"
,
sku
.
GoodsId
))
//京东锁库数量
jd_stock_t
=
gconv
.
Int64
(
jdStockShiwuStr
)
-
gconv
.
Int64
(
jdStockLockStr
)
jd_stock_t
=
gconv
.
Int64
(
jdStockShiwuStr
)
-
gconv
.
Int64
(
jdStockLockStr
)
}
}
return
stock_all_t
,
jd_stock_t
,
sku
sku
.
Stock
=
stock_all_t
sku
.
StockJd
=
jd_stock_t
return
sku
}
}
// 合并spu的信息
// 合并spu的信息
...
...
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