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
9539e110
authored
Dec 09, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
debug
parent
0ff12139
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
service/service_price.go
service/service_price.go
View file @
9539e110
...
...
@@ -23,16 +23,12 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe
if
suffix
==
""
&&
sku
.
SupplierId
==
14
{
return
getMouserActivityPrice
(
sku
)
}
contentSlice
=
append
(
contentSlice
,
sku
)
sku
.
Content
=
contentSlice
//先获取活动信息,针对不同供应商不同活动类型做活动吗,每个活动只能针对一个供应商
//比如有 Self_ActivityPrice_2_Discount,Self_ActivityPrice_1_NewCustomer
redisCon
:=
gredis
.
Conn
(
"default_r"
)
defer
redisCon
.
Close
()
supplierIdStr
:=
strconv
.
Itoa
(
int
(
sku
.
SupplierId
))
activityInfo
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"GET"
,
"Self_ActivityPrice_"
+
supplierIdStr
+
suffix
))
contentSlice
=
append
(
contentSlice
,
activityInfo
)
sku
.
Content
=
contentSlice
//找不到对应的活动价格信息,就直接返回空
if
activityInfo
==
""
{
...
...
@@ -49,12 +45,16 @@ contentSlice = append(contentSlice,sku)
//获取redis里面存储的活动相关信息
brandIdArray
:=
gjson
.
Get
(
activityInfo
,
"brand_id"
)
.
Array
()
contentSlice
=
append
(
contentSlice
,
brandIdArray
)
sku
.
Content
=
contentSlice
var
brandIds
[]
string
for
_
,
brandId
:=
range
brandIdArray
{
if
brandId
.
String
()
!=
""
{
brandIds
=
append
(
brandIds
,
brandId
.
String
())
}
}
contentSlice
=
append
(
contentSlice
,
brandIds
)
sku
.
Content
=
contentSlice
goodsNameArray
:=
gjson
.
Get
(
activityInfo
,
"goods_name"
)
.
Array
()
var
goodsNames
[]
string
for
_
,
goodsName
:=
range
goodsNameArray
{
...
...
@@ -138,6 +138,8 @@ contentSlice = append(contentSlice,sku)
visibleRoster
:=
gjson
.
Get
(
activityInfo
,
"visible_roster"
)
.
String
()
if
suffix
==
"_Member"
&&
gjson
.
Get
(
activityInfo
,
"is_part"
)
.
Int
()
==
1
&&
visibleRoster
!=
""
{
contentSlice
=
append
(
contentSlice
,
"进来进来"
)
sku
.
Content
=
contentSlice
//为了用字符串匹配
visibleRoster
=
","
+
visibleRoster
+
","
//提取出user_id、手机号、邮箱
...
...
@@ -190,6 +192,9 @@ contentSlice = append(contentSlice,sku)
//}
}
}
contentSlice
=
append
(
contentSlice
,
"提前返回"
)
contentSlice
=
append
(
contentSlice
,
hasActivity
)
sku
.
Content
=
contentSlice
//判断是否有活动
if
!
hasActivity
{
return
sku
...
...
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