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
93fecd46
authored
Dec 09, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
debug
parent
c4356e00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
service/service_price.go
tests/test.go
service/service_price.go
View file @
93fecd46
...
...
@@ -45,10 +45,10 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe
//获取redis里面存储的活动相关信息
brandIdArray
:=
gjson
.
Get
(
activityInfo
,
"brand_id"
)
.
Array
()
var
brandIds
[]
string
var
brandIds
[]
int
for
_
,
brandId
:=
range
brandIdArray
{
if
brandId
.
String
()
!=
""
{
brandIds
=
append
(
brandIds
,
brandId
.
String
(
))
brandIds
=
append
(
brandIds
,
int
(
brandId
.
Int
()
))
}
}
goodsNameArray
:=
gjson
.
Get
(
activityInfo
,
"goods_name"
)
.
Array
()
...
...
tests/test.go
View file @
93fecd46
...
...
@@ -6,9 +6,7 @@ import (
)
func
main
()
{
str
:=
`{"cn":{"max":"10000","price":"20"},"hk":{"max":69000,"price":138}}`
var
res
interface
{}
fmt
.
Println
(
php2go
.
JSONDecode
([]
byte
(
str
),
&
res
))
tem
,
_
:=
php2go
.
JSONEncode
(
res
)
fmt
.
Println
(
string
(
tem
))
var
a
=
[]
string
{
"3923"
}
var
b
=
3923
fmt
.
Println
(
php2go
.
InArray
(
b
,
a
))
}
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