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
44001764
authored
Dec 09, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
3e0759da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
service/service_zy.go
service/service_zy.go
View file @
44001764
...
...
@@ -206,14 +206,12 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
}
A
.
Set
(
"scm_brand_name"
,
gjson
.
Get
(
info
,
"scm_brand_name"
)
.
String
())
//
A
.
Set
(
"ac_type"
,
gjson
.
Get
(
info
,
"ac_type"
)
.
Int
())
//
//处理系数
ratio
,
_
:=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"zy_ratio_sku"
,
goods_id
))
var
PriceAc
float64
=
0
var
PriceAc
Xi
float64
=
0
//系数
if
ratio
!=
""
{
PriceAc
=
gjson
.
Get
(
ratio
,
"price_ac"
)
.
Float
()
PriceAc
Xi
=
gjson
.
Get
(
ratio
,
"price_ac"
)
.
Float
()
//获取立创价格
if
gjson
.
Parse
(
"szlc_price"
)
.
String
()
==
""
{
A
.
Set
(
"szlc_price"
,
nil
)
...
...
@@ -230,6 +228,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
A
.
Set
(
"allow_coupon"
,
gjson
.
Get
(
ratio
,
"allow_coupon"
)
.
String
())
A
.
Set
(
"allow_presale"
,
gjson
.
Get
(
ratio
,
"allow_presale"
)
.
String
())
A
.
Set
(
"ac_type"
,
6
)
//系数
}
//拼接梯度价格
...
...
@@ -239,7 +238,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
if
v
.
Get
(
"purchases"
)
.
String
()
==
""
{
continue
;
}
if
PriceAc
==
0
{
if
PriceAc
Xi
==
0
{
ladderPrice
=
append
(
ladderPrice
,
model
.
LadderPrice
{
Purchases
:
v
.
Get
(
"purchases"
)
.
Int
(),
PriceCn
:
v
.
Get
(
"price_cn"
)
.
Float
(),
...
...
@@ -248,9 +247,10 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
ladderPrice
=
append
(
ladderPrice
,
model
.
LadderPrice
{
Purchases
:
v
.
Get
(
"purchases"
)
.
Int
(),
PriceCn
:
v
.
Get
(
"price_cn"
)
.
Float
(),
PriceAc
:
PriceAc
,
PriceAc
:
PriceAc
Xi
,
})
}
}
if
len
(
ladderPrice
)
==
0
{
...
...
@@ -271,15 +271,18 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
}
else
{
A
.
Set
(
"is_buy"
,
1
)
}
//处理活动价
A
.
Set
(
"ac_type"
,
0
)
A
.
Set
(
"allow_coupon"
,
1
)
Ac_price
:=
qs
.
ActivityPrice
(
ctx
,
info
,
&
redisConn
)
if
Ac_price
!=
nil
{
keys
:=
Ac_price
.
Keys
()
for
_
,
k
:=
range
keys
{
v
,
_
:=
Ac_price
.
Get
(
k
)
A
.
Set
(
k
,
v
)
//活动价格覆盖
if
PriceAcXi
==
0
{
//没有系数价格才处理活动价
//处理活动价
A
.
Set
(
"ac_type"
,
0
)
A
.
Set
(
"allow_coupon"
,
1
)
Ac_price
:=
qs
.
ActivityPrice
(
ctx
,
info
,
&
redisConn
)
if
Ac_price
!=
nil
{
keys
:=
Ac_price
.
Keys
()
for
_
,
k
:=
range
keys
{
v
,
_
:=
Ac_price
.
Get
(
k
)
A
.
Set
(
k
,
v
)
//活动价格覆盖
}
}
}
...
...
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