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
...
@@ -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
(
"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
))
ratio
,
_
:=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"zy_ratio_sku"
,
goods_id
))
var
PriceAc
float64
=
0
var
PriceAc
Xi
float64
=
0
//系数
if
ratio
!=
""
{
if
ratio
!=
""
{
PriceAc
=
gjson
.
Get
(
ratio
,
"price_ac"
)
.
Float
()
PriceAc
Xi
=
gjson
.
Get
(
ratio
,
"price_ac"
)
.
Float
()
//获取立创价格
//获取立创价格
if
gjson
.
Parse
(
"szlc_price"
)
.
String
()
==
""
{
if
gjson
.
Parse
(
"szlc_price"
)
.
String
()
==
""
{
A
.
Set
(
"szlc_price"
,
nil
)
A
.
Set
(
"szlc_price"
,
nil
)
...
@@ -230,6 +228,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
...
@@ -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_coupon"
,
gjson
.
Get
(
ratio
,
"allow_coupon"
)
.
String
())
A
.
Set
(
"allow_presale"
,
gjson
.
Get
(
ratio
,
"allow_presale"
)
.
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
...
@@ -239,7 +238,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
if
v
.
Get
(
"purchases"
)
.
String
()
==
""
{
if
v
.
Get
(
"purchases"
)
.
String
()
==
""
{
continue
;
continue
;
}
}
if
PriceAc
==
0
{
if
PriceAc
Xi
==
0
{
ladderPrice
=
append
(
ladderPrice
,
model
.
LadderPrice
{
ladderPrice
=
append
(
ladderPrice
,
model
.
LadderPrice
{
Purchases
:
v
.
Get
(
"purchases"
)
.
Int
(),
Purchases
:
v
.
Get
(
"purchases"
)
.
Int
(),
PriceCn
:
v
.
Get
(
"price_cn"
)
.
Float
(),
PriceCn
:
v
.
Get
(
"price_cn"
)
.
Float
(),
...
@@ -248,9 +247,10 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
...
@@ -248,9 +247,10 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
ladderPrice
=
append
(
ladderPrice
,
model
.
LadderPrice
{
ladderPrice
=
append
(
ladderPrice
,
model
.
LadderPrice
{
Purchases
:
v
.
Get
(
"purchases"
)
.
Int
(),
Purchases
:
v
.
Get
(
"purchases"
)
.
Int
(),
PriceCn
:
v
.
Get
(
"price_cn"
)
.
Float
(),
PriceCn
:
v
.
Get
(
"price_cn"
)
.
Float
(),
PriceAc
:
PriceAc
,
PriceAc
:
PriceAc
Xi
,
})
})
}
}
}
}
if
len
(
ladderPrice
)
==
0
{
if
len
(
ladderPrice
)
==
0
{
...
@@ -271,15 +271,18 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
...
@@ -271,15 +271,18 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
}
else
{
}
else
{
A
.
Set
(
"is_buy"
,
1
)
A
.
Set
(
"is_buy"
,
1
)
}
}
//处理活动价
A
.
Set
(
"ac_type"
,
0
)
if
PriceAcXi
==
0
{
//没有系数价格才处理活动价
A
.
Set
(
"allow_coupon"
,
1
)
//处理活动价
Ac_price
:=
qs
.
ActivityPrice
(
ctx
,
info
,
&
redisConn
)
A
.
Set
(
"ac_type"
,
0
)
if
Ac_price
!=
nil
{
A
.
Set
(
"allow_coupon"
,
1
)
keys
:=
Ac_price
.
Keys
()
Ac_price
:=
qs
.
ActivityPrice
(
ctx
,
info
,
&
redisConn
)
for
_
,
k
:=
range
keys
{
if
Ac_price
!=
nil
{
v
,
_
:=
Ac_price
.
Get
(
k
)
keys
:=
Ac_price
.
Keys
()
A
.
Set
(
k
,
v
)
//活动价格覆盖
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