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
f30f1ec7
authored
Dec 01, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
7d1eb42a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
service/service_zy_cron.go
service/service_zy_cron.go
View file @
f30f1ec7
...
...
@@ -177,8 +177,9 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
//查询立创数据
szlcPriceStr
,
_
:=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"Self_szlc_price"
,
now_goods_id
))
//获取立创价格
if
szlcPriceStr
!=
""
{
//有立创的价格
nowLadder
:=
gjson
.
Get
(
a
[
"ladder_price"
],
"purchases"
)
.
Array
()
nowLadder
:=
gjson
.
Parse
(
a
[
"ladder_price"
]
)
.
Array
()
endnowLadder
:=
nowLadder
[
len
(
nowLadder
)
-
1
]
.
Get
(
"purchases"
)
.
Int
()
//最后一个梯度
fmt
.
Println
(
endnowLadder
)
//获取立创对应的梯度价格
szlcPriceArr
:=
gjson
.
Parse
(
szlcPriceStr
)
.
Array
()
var
szlcPrice
float64
=
0
//找到立创对应的梯度价格
...
...
@@ -189,7 +190,7 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
}
szlcPrice
=
szlcPrice
*
0.95
//立创95折
if
ratioPrice
>
szlcPrice
{
//比立创的95折大
minPrice
:=
common
.
MyFloat64
(
a
[
"cost"
])
*
common
.
MyFloat64
(
info
[
"min_ratio"
])
minPrice
:=
math
.
Ceil
(
gconv
.
Float64
(
a
[
"cost"
])
*
gconv
.
Float64
(
info
[
"min_ratio"
])
*
10000
)
/
10000
if
szlcPrice
<
minPrice
{
ratioPrice
=
minPrice
}
else
{
...
...
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