Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
bom_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
5b4a4d21
authored
Jun 02, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复价格问题
parent
ca209b30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
internal/logic/goods.go
internal/logic/goods.go
View file @
5b4a4d21
...
@@ -30,7 +30,7 @@ func UpdateGoodsData(goodsMapList []GoodsMap) (err error) {
...
@@ -30,7 +30,7 @@ func UpdateGoodsData(goodsMapList []GoodsMap) (err error) {
}
}
goodsIdsStr
:=
strings
.
Join
(
goodsIds
,
","
)
goodsIdsStr
:=
strings
.
Join
(
goodsIds
,
","
)
goodsList
,
err
:=
GetGoodsInfo
(
goodsIdsStr
)
goodsList
,
err
:=
GetGoodsInfo
(
goodsIdsStr
)
if
len
(
goodsMapList
)
!=
0
{
if
len
(
goodsMapList
)
!=
0
{
bomId
=
goodsMapList
[
0
]
.
BomId
bomId
=
goodsMapList
[
0
]
.
BomId
}
}
//fmt.Println(goodsIdsStr)
//fmt.Println(goodsIdsStr)
...
@@ -195,22 +195,29 @@ func MatchGoodsInfo(goods model.ApiGoods, goodsMap GoodsMap) (bomMatching model.
...
@@ -195,22 +195,29 @@ func MatchGoodsInfo(goods model.ApiGoods, goodsMap GoodsMap) (bomMatching model.
}
}
bomMatching
.
LadderPrice
=
string
(
ladderPriceStr
)
bomMatching
.
LadderPrice
=
string
(
ladderPriceStr
)
//获取美元和人民币的价格(需要去判断数量)
//获取美元和人民币的价格(需要去判断数量)
var
ladder
model
.
LadderPrice
for
_
,
price
:=
range
goods
.
LadderPrice
{
for
_
,
price
:=
range
goods
.
LadderPrice
{
//需要用于获取价格的阶梯价
if
goodsMap
.
Number
<=
price
.
Purchases
{
if
goodsMap
.
Number
<=
price
.
Purchases
{
//判断收货地,1是大陆,2是香港
ladder
=
price
if
goodsMap
.
DeliveryType
==
1
{
//判断是否有优惠价,有的话取优惠价
if
price
.
PriceAc
!=
0
{
bomMatching
.
Price
=
price
.
PriceAc
}
else
{
bomMatching
.
Price
=
price
.
PriceCn
}
}
else
{
bomMatching
.
Price
=
price
.
PriceUs
}
break
break
}
}
}
}
//如果都没有小于的阶梯价数量,则代表要去取最后一个阶梯价格
if
ladder
.
Purchases
==
0
{
ladder
=
goods
.
LadderPrice
[
len
(
goods
.
LadderPrice
)
-
1
]
}
//判断收货地,1是大陆,2是香港
if
goodsMap
.
DeliveryType
==
1
{
//判断是否有优惠价,有的话取优惠价
if
ladder
.
PriceAc
!=
0
{
bomMatching
.
Price
=
ladder
.
PriceAc
}
else
{
bomMatching
.
Price
=
ladder
.
PriceCn
}
}
else
{
bomMatching
.
Price
=
ladder
.
PriceUs
}
}
}
return
return
}
}
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