Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
go_supplier_sever
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
46624b0e
authored
May 21, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化脚本
parent
6cd9a63a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
3 deletions
app/service/supplier_sku_mode.go
app/service/supplier_sku_mode.go
View file @
46624b0e
...
...
@@ -45,7 +45,6 @@ func SaveSkuModeFromES() (err error) {
goodsIdArr
:=
gjson
.
Get
(
result
,
"data.goods_id"
)
.
Array
()
// fmt.Println("当前处理供应商为 : ", supplier.SupplierName)
if
len
(
goodsIdArr
)
>
0
{
fmt
.
Println
(
"存在商品"
)
//取一个goods_id就好
goodsId
:=
goodsIdArr
[
0
]
.
String
()
//fmt.Println("skuId为 : " + goodsId)
...
...
@@ -72,7 +71,6 @@ func SaveSkuModeFromES() (err error) {
sku
:=
redisCon
.
HGet
(
"sku"
,
goodsId
)
.
String
()
skuExpiredInDays
:=
0
cpTime
:=
gjson
.
Get
(
sku
,
"cp_time"
)
.
Int
()
fmt
.
Println
(
"cpTime:"
,
cpTime
)
if
cpTime
>
0
{
//cp_time是时间戳,转成日期和当前日期对比计算天数
cpTimeDate
:=
time
.
Unix
(
cpTime
,
0
)
...
...
@@ -87,7 +85,7 @@ func SaveSkuModeFromES() (err error) {
}
}
if
skuExpiredInDays
>
0
{
fmt
.
Println
(
"sku过期天数 : "
,
skuExpiredInDays
)
fmt
.
Println
(
"sku过期天数 : "
,
skuExpiredInDays
,
"供应商编码 : "
,
supplier
.
SupplierCode
)
}
err
=
dao
.
UpdateSupplierSkuExpiredInDays
(
supplier
.
SupplierId
,
skuExpiredInDays
)
if
err
!=
nil
{
...
...
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