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
81cba3bb
authored
Mar 21, 2023
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复价格问题
parent
84490a0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
service/service_ly_common.go
service/service_ly_common.go
View file @
81cba3bb
...
...
@@ -230,8 +230,9 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//找一个标志位,因为默认的全局折扣系数的数据格式和非全局的是不一样的
isDefaultDiscoutRatio
:=
false
discountRatio
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"magic_cube_channel_discount_daigou"
,
sku
.
SupplierId
))
checkNullRation
:=
gjson
.
Get
(
discountRatio
,
"ration"
)
.
String
()
//如果这个渠道没有对应的折扣系数,那么就去读取全局的
if
discountRatio
==
""
{
if
discountRatio
==
""
||
checkNullRation
==
""
{
isDefaultDiscoutRatio
=
true
discountRatio
,
_
=
redis
.
String
(
redisCon
.
Do
(
"GET"
,
"magic_cube_channel_discount_default_daigou"
))
}
...
...
@@ -262,7 +263,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
goodsNames
:=
gjson
.
Get
(
discountRatio
,
"goods_name."
+
sortString
)
.
String
()
if
goodsNames
!=
""
{
hasSpecialCheck
=
true
goodsNameList
:=
strings
.
Split
(
goodsNames
,
"
€
"
)
goodsNameList
:=
strings
.
Split
(
goodsNames
,
"
@€@
"
)
//找到有对应的商品名称,那么优先级肯定是最高的了
if
php2go
.
InArray
(
sku
.
GoodsName
,
goodsNameList
)
{
break
...
...
@@ -273,7 +274,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
brandIds
:=
gjson
.
Get
(
discountRatio
,
"brand."
+
sortString
)
.
String
()
if
brandIds
!=
""
{
hasSpecialCheck
=
true
standardBrandIdList
:=
strings
.
Split
(
brandIds
,
"
€
"
)
standardBrandIdList
:=
strings
.
Split
(
brandIds
,
"
@€@
"
)
standardBrandId
:=
strconv
.
Itoa
(
sku
.
StandardBrand
.
StandardBrandId
)
//找到有对应的品牌,那么优先级肯定是最高的了
if
php2go
.
InArray
(
standardBrandId
,
standardBrandIdList
)
{
...
...
@@ -296,8 +297,9 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//找一个标志位,因为默认的全局折扣系数的数据格式和非全局的是不一样的
isDefaultPriceRatio
:=
false
priceRatioCache
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"magic_cube_price_rule_channel"
,
sku
.
SupplierId
))
checkNullRation
=
gjson
.
Get
(
priceRatioCache
,
"ladder_price"
)
.
String
()
//如果这个渠道没有对应的折扣系数,那么就去读取全局的
if
priceRatioCache
==
""
{
if
priceRatioCache
==
""
||
checkNullRation
==
""
{
isDefaultPriceRatio
=
true
priceRatioCache
,
_
=
redis
.
String
(
redisCon
.
Do
(
"GET"
,
"magic_cube_price_rule_channel_default"
))
}
...
...
@@ -346,7 +348,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
goodsNames
:=
gjson
.
Get
(
priceRatioCache
,
"goods_name."
+
sortString
)
.
String
()
if
goodsNames
!=
""
{
hasSpecialCheck
=
true
goodsNameList
:=
strings
.
Split
(
goodsNames
,
"
€
"
)
goodsNameList
:=
strings
.
Split
(
goodsNames
,
"
@€@
"
)
//找到有对应的商品名称,那么优先级肯定是最高的了
if
php2go
.
InArray
(
sku
.
GoodsName
,
goodsNameList
)
{
break
...
...
@@ -357,7 +359,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
brandIds
:=
gjson
.
Get
(
priceRatioCache
,
"brand."
+
sortString
)
.
String
()
if
brandIds
!=
""
{
hasSpecialCheck
=
true
standardBrandIdList
:=
strings
.
Split
(
brandIds
,
"
€
"
)
standardBrandIdList
:=
strings
.
Split
(
brandIds
,
"
@€@
"
)
standardBrandId
:=
strconv
.
Itoa
(
sku
.
StandardBrand
.
StandardBrandId
)
//找到有对应的品牌,那么优先级肯定是最高的了
if
php2go
.
InArray
(
standardBrandId
,
standardBrandIdList
)
{
...
...
@@ -368,7 +370,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//判断是否有符合的eccn
eccns
:=
gjson
.
Get
(
priceRatioCache
,
"eccn."
+
sortString
)
.
String
()
if
eccns
!=
""
{
eccnList
:=
strings
.
Split
(
eccns
,
"
€
"
)
eccnList
:=
strings
.
Split
(
eccns
,
"
@€@
"
)
fmt
.
Println
(
eccnList
)
//找到有对应的eccn,那么优先级肯定是最高的了
for
_
,
eccn
:=
range
eccnList
{
...
...
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