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
3173a672
authored
Nov 20, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-可售库存-20251118' into dev
parents
75c4d7f6
04b6558a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
service/service_ly.go
service/service_stock_info.go
service/service_ly.go
View file @
3173a672
...
@@ -176,8 +176,8 @@ func (ls *LyService) LyGoodsDetail(ctx context.Context, params RequestParams, go
...
@@ -176,8 +176,8 @@ func (ls *LyService) LyGoodsDetail(ctx context.Context, params RequestParams, go
sku
.
OnwayStock
=
ls
.
getOnwayStock
(
sku
.
GoodsId
)
sku
.
OnwayStock
=
ls
.
getOnwayStock
(
sku
.
GoodsId
)
//获取新的限制库存信息
//获取新的限制库存信息
limitStock
:=
ls
.
getLimitStock
(
sku
.
GoodsId
)
has
,
limitStock
:=
ls
.
getLimitStock
(
sku
.
GoodsId
)
if
limitStock
>
0
{
if
has
{
sku
.
Stock
=
int64
(
limitStock
)
sku
.
Stock
=
int64
(
limitStock
)
}
}
...
...
service/service_stock_info.go
View file @
3173a672
...
@@ -70,7 +70,7 @@ func (ss *LyService) getOnwayStock(goodsId string) int {
...
@@ -70,7 +70,7 @@ func (ss *LyService) getOnwayStock(goodsId string) int {
}
}
// 获取新的在途库存
// 获取新的在途库存
func
(
ss
*
LyService
)
getLimitStock
(
goodsId
string
)
int
{
func
(
ss
*
LyService
)
getLimitStock
(
goodsId
string
)
(
has
bool
,
stock
int
)
{
redisConn
:=
gredis
.
Conn
(
"search_r"
)
redisConn
:=
gredis
.
Conn
(
"search_r"
)
defer
func
()
{
defer
func
()
{
redisConn
.
Close
()
redisConn
.
Close
()
...
@@ -78,8 +78,8 @@ func (ss *LyService) getLimitStock(goodsId string) int {
...
@@ -78,8 +78,8 @@ func (ss *LyService) getLimitStock(goodsId string) int {
limitStockStr
,
_
:=
redis
.
String
(
redisConn
.
Do
(
"HGET"
,
"limit_stock"
,
goodsId
))
limitStockStr
,
_
:=
redis
.
String
(
redisConn
.
Do
(
"HGET"
,
"limit_stock"
,
goodsId
))
if
limitStockStr
==
""
{
if
limitStockStr
==
""
{
return
0
return
false
,
0
}
}
return
gconv
.
Int
(
limitStockStr
)
return
true
,
gconv
.
Int
(
limitStockStr
)
}
}
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