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
9df49dec
authored
Jun 03, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
46624b0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
app/service/supplier_sku_mode.go
config/dev/config.toml
app/service/supplier_sku_mode.go
View file @
9df49dec
...
...
@@ -17,7 +17,7 @@ func SaveSkuModeFromES() (err error) {
supplier
:=
new
(
model
.
Supplier
)
//先去根据供应商内部编码找出对应的supplierId
rows
,
err
:=
dao
.
Dao
.
GetDb
(
"supplier"
)
.
Table
(
"lie_supplier_channel"
)
.
// Where("supplier_code = ?", "L00
01175
").
// Where("supplier_code = ?", "L00
12486
").
Where
(
"is_type = ?"
,
0
)
.
Where
(
"uploaded_sku = ?"
,
1
)
.
OrderBy
(
"supplier_id desc"
)
.
...
...
@@ -34,7 +34,7 @@ func SaveSkuModeFromES() (err error) {
params
:=
req
.
Param
{
"canal/condition"
:
supplier
.
SupplierCode
,
"cp_time/sort"
:
"asc"
,
"cp_time/n
eq"
:
0
,
"cp_time/n
o_eqs"
:
0
,
}
url
:=
lib
.
Instance
(
"config"
)
.
GetString
(
"es.es_sku_url"
)
resp
,
err
:=
req
.
Post
(
url
,
params
)
...
...
@@ -43,11 +43,12 @@ func SaveSkuModeFromES() (err error) {
}
result
:=
resp
.
String
()
goodsIdArr
:=
gjson
.
Get
(
result
,
"data.goods_id"
)
.
Array
()
// fmt.Println(goodsIdArr)
// fmt.Println("当前处理供应商为 : ", supplier.SupplierName)
if
len
(
goodsIdArr
)
>
0
{
//取一个goods_id就好
goodsId
:=
goodsIdArr
[
0
]
.
String
()
//
fmt.Println("skuId为 : " + goodsId)
fmt
.
Println
(
"skuId为 : "
+
goodsId
)
//去redis里面找出对应的goods_label
redisCon
:=
dao
.
Dao
.
GetRedisDbGroup
(
"sku"
)
result
:=
redisCon
.
HGet
(
"goods_tag"
,
goodsId
)
.
String
()
...
...
@@ -71,6 +72,7 @@ func SaveSkuModeFromES() (err error) {
sku
:=
redisCon
.
HGet
(
"sku"
,
goodsId
)
.
String
()
skuExpiredInDays
:=
0
cpTime
:=
gjson
.
Get
(
sku
,
"cp_time"
)
.
Int
()
fmt
.
Println
(
cpTime
)
if
cpTime
>
0
{
//cp_time是时间戳,转成日期和当前日期对比计算天数
cpTimeDate
:=
time
.
Unix
(
cpTime
,
0
)
...
...
config/dev/config.toml
View file @
9df49dec
...
...
@@ -2,4 +2,5 @@
url
=
"amqp://guest:guest@192.168.1.252:5672/"
[es]
es_sku_url
=
"https://icso.ichunt.com/search/es/searchSku"
\ No newline at end of file
# es_sku_url = "https://icso.ichunt.com/search/es/searchSku"
es_sku_url
=
"http://search.liexindev.net/search/es/searchSku"
\ No newline at end of file
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