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
1314bae4
authored
Dec 08, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
ssh://119.23.72.7:22611/q578953158/go_sku_server
parents
48e8d77e
2b0f4f7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
service/service_zy.go
service/service_zy_common.go
service/service_zy.go
View file @
1314bae4
...
...
@@ -208,17 +208,7 @@ 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
())
//
//处理活动价
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
)
//活动价格覆盖
}
}
//处理系数
ratio
,
_
:=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"zy_ratio_sku"
,
goods_id
))
var
PriceAc
float64
=
0
...
...
@@ -281,6 +271,17 @@ 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
)
//活动价格覆盖
}
}
//最后写入sync map
(
GoodsRes
)
.
Store
(
goods_id
,
A
)
...
...
service/service_zy_common.go
View file @
1314bae4
...
...
@@ -44,7 +44,7 @@ func (qs *ZiyingService) ActivityPrice(ctx *gin.Context,SkuInfo string,c *redis.
ctx
.
Request
.
FormValue
(
"power[newCustomer]"
)
==
"1"
{
goodsActivityPrice
,
_
:=
gredis
.
String
((
*
c
)
.
Do
(
"get"
,
"Self_ActivityPrice_10000_NewCustomer"
))
if
goodsActivityPrice
!=
""
{
data
:=
qs
.
HDActivityPrice
(
ctx
,
goodsActivityPrice
,
SkuInfo
,
"5"
)
data
:=
qs
.
HDActivityPrice
(
ctx
,
goodsActivityPrice
,
SkuInfo
,
"5"
)
if
data
!=
nil
{
return
data
}
...
...
@@ -53,6 +53,8 @@ func (qs *ZiyingService) ActivityPrice(ctx *gin.Context,SkuInfo string,c *redis.
}
//团购限制
data
:=
qs
.
HDGoodsLimit
(
gjson
.
Get
(
SkuInfo
,
"goods_id"
)
.
String
(),
gjson
.
Get
(
SkuInfo
,
"stock"
)
.
String
(),
c
)
common
.
PrintDebugHtml
(
ctx
,
data
)
if
data
!=
nil
{
return
data
}
...
...
@@ -229,7 +231,7 @@ func (qs *ZiyingService) HDGoodsLimit(SkuID string,Stock string,c *redis.Conn)
ladderType
:=
make
([]
model
.
LadderPrice
,
0
)
for
_
,
v
:=
range
ladder_price_arr
{
ladderType
=
append
(
ladderType
,
model
.
LadderPrice
{
Purchases
:
v
.
Get
(
"
P
urchases"
)
.
Int
(),
Purchases
:
v
.
Get
(
"
p
urchases"
)
.
Int
(),
PriceCn
:
v
.
Get
(
"price_cn"
)
.
Float
(),
PriceAc
:
v
.
Get
(
"price_ac"
)
.
Float
(),
})
...
...
@@ -253,7 +255,6 @@ func (qs *ZiyingService) HDGoodsLimit(SkuID string,Stock string,c *redis.Conn)
if
now_stock
>
common
.
MyFloat64
(
Stock
)
||
now_stock
==
0
{
return
nil
}
return
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