Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_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
0a92ce2a
authored
Apr 20, 2023
by
SUDPTDUBLXEROFX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
交期
parent
cb50a0de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
service/goods_service.go
service/goods_service.go
View file @
0a92ce2a
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"github.com/gomodule/redigo/redis"
"github.com/gomodule/redigo/redis"
"github.com/imroc/req"
"github.com/imroc/req"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"github.com/tidwall/gjson"
"search_server/model"
"search_server/model"
"search_server/pkg/common"
"search_server/pkg/common"
...
@@ -67,6 +68,8 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
...
@@ -67,6 +68,8 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
return
return
}
}
goodsListMap
=
make
(
map
[
string
]
model
.
ApiGoods
,
1000
)
goodsListMap
=
make
(
map
[
string
]
model
.
ApiGoods
,
1000
)
dayFilter
:=
[]
string
{
"工作日"
,
"个工作日"
,
"日"
,
"个"
}
//先判断返回的data是不是字典,不是字典代表可能是返回字符串了
//先判断返回的data是不是字典,不是字典代表可能是返回字符串了
if
gjson
.
Get
(
resp
.
String
(),
"data"
)
.
IsObject
()
{
if
gjson
.
Get
(
resp
.
String
(),
"data"
)
.
IsObject
()
{
//排序操作
//排序操作
...
@@ -97,6 +100,13 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
...
@@ -97,6 +100,13 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
"sign"
:
gjson
.
Get
(
ActivityInfoStr
,
"sign"
)
.
String
(),
"sign"
:
gjson
.
Get
(
ActivityInfoStr
,
"sign"
)
.
String
(),
"show_name"
:
gjson
.
Get
(
ActivityInfoStr
,
"show_name"
)
.
String
(),
"show_name"
:
gjson
.
Get
(
ActivityInfoStr
,
"show_name"
)
.
String
(),
}
}
hk_delivery_time
:=
data
.
Get
(
"hk_delivery_time"
)
.
String
()
cn_delivery_time
:=
data
.
Get
(
"cn_delivery_time"
)
.
String
()
for
_
,
v
:=
range
dayFilter
{
hk_delivery_time
=
php2go
.
StrReplace
(
v
,
""
,
hk_delivery_time
,
1
)
cn_delivery_time
=
php2go
.
StrReplace
(
v
,
""
,
cn_delivery_time
,
1
)
}
goods
.
ActivityInfo
=
ActivityInfo
goods
.
ActivityInfo
=
ActivityInfo
goods
.
StandardBrandName
=
""
goods
.
StandardBrandName
=
""
...
@@ -115,8 +125,8 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
...
@@ -115,8 +125,8 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
goods
.
MoqStr
=
int
(
data
.
Get
(
"moq"
)
.
Int
())
goods
.
MoqStr
=
int
(
data
.
Get
(
"moq"
)
.
Int
())
goods
.
Stock
=
int
(
data
.
Get
(
"stock"
)
.
Int
())
goods
.
Stock
=
int
(
data
.
Get
(
"stock"
)
.
Int
())
goods
.
StockStr
=
int
(
data
.
Get
(
"stock"
)
.
Int
())
goods
.
StockStr
=
int
(
data
.
Get
(
"stock"
)
.
Int
())
goods
.
HkDeliveryTime
=
data
.
Get
(
"hk_delivery_time"
)
.
String
()
goods
.
HkDeliveryTime
=
hk_delivery_time
goods
.
CnDeliveryTime
=
data
.
Get
(
"cn_delivery_time"
)
.
String
()
goods
.
CnDeliveryTime
=
cn_delivery_time
goods
.
BrandName
=
data
.
Get
(
"brand_name"
)
.
String
()
goods
.
BrandName
=
data
.
Get
(
"brand_name"
)
.
String
()
goods
.
SupplierName
=
data
.
Get
(
"supplier_name"
)
.
String
()
goods
.
SupplierName
=
data
.
Get
(
"supplier_name"
)
.
String
()
goods
.
BrandId
=
int
(
data
.
Get
(
"brand_id"
)
.
Int
())
goods
.
BrandId
=
int
(
data
.
Get
(
"brand_id"
)
.
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