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
bcdd29f4
authored
Mar 15, 2023
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
售价系数判断问题
parent
77e2a838
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
service/service_activity.go
service/service_ly_common.go
service/service_activity.go
View file @
bcdd29f4
...
@@ -162,7 +162,6 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
...
@@ -162,7 +162,6 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
}
}
}
}
}
else
{
}
else
{
fmt
.
Println
(
activity
)
//判断是否是搞活动的品牌
//判断是否是搞活动的品牌
if
as
.
CheckStandardBrand
(
checkData
.
StandardBrandId
,
activity
)
{
if
as
.
CheckStandardBrand
(
checkData
.
StandardBrandId
,
activity
)
{
hasActivity
=
true
hasActivity
=
true
...
...
service/service_ly_common.go
View file @
bcdd29f4
...
@@ -333,32 +333,38 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
...
@@ -333,32 +333,38 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
}
}
//判断是否有符合的商品名称
//判断是否有符合的商品名称
goodsNames
:=
gjson
.
Get
(
priceRatioCache
,
"goods_name."
+
sortString
)
.
String
()
goodsNames
:=
gjson
.
Get
(
priceRatioCache
,
"goods_name."
+
sortString
)
.
String
()
goodsNameList
:=
strings
.
Split
(
goodsNames
,
"€"
)
if
goodsNames
!=
""
{
//找到有对应的商品名称,那么优先级肯定是最高的了
goodsNameList
:=
strings
.
Split
(
goodsNames
,
"€"
)
if
php2go
.
InArray
(
sku
.
GoodsName
,
goodsNameList
)
{
//找到有对应的商品名称,那么优先级肯定是最高的了
break
if
php2go
.
InArray
(
sku
.
GoodsName
,
goodsNameList
)
{
break
}
}
}
//判断是否有符合的标准品牌ID
//判断是否有符合的标准品牌ID
brandIds
:=
gjson
.
Get
(
priceRatioCache
,
"brand"
+
sortString
)
.
String
()
brandIds
:=
gjson
.
Get
(
priceRatioCache
,
"brand"
+
sortString
)
.
String
()
standardBrandIdList
:=
strings
.
Split
(
brandIds
,
"€"
)
if
brandIds
!=
""
{
standardBrandId
:=
strconv
.
Itoa
(
sku
.
StandardBrand
.
StandardBrandId
)
standardBrandIdList
:=
strings
.
Split
(
brandIds
,
"€"
)
//找到有对应的品牌,那么优先级肯定是最高的了
standardBrandId
:=
strconv
.
Itoa
(
sku
.
StandardBrand
.
StandardBrandId
)
if
php2go
.
InArray
(
standardBrandId
,
standardBrandIdList
)
{
//找到有对应的品牌,那么优先级肯定是最高的了
break
if
php2go
.
InArray
(
standardBrandId
,
standardBrandIdList
)
{
break
}
}
}
//判断是否有符合的eccn
//判断是否有符合的eccn
eccns
:=
gjson
.
Get
(
priceRatioCache
,
"eccn"
+
sortString
)
.
String
()
eccns
:=
gjson
.
Get
(
priceRatioCache
,
"eccn"
+
sortString
)
.
String
()
eccnList
:=
strings
.
Split
(
eccns
,
"€"
)
if
eccns
!=
""
{
//找到有对应的eccn,那么优先级肯定是最高的了
eccnList
:=
strings
.
Split
(
eccns
,
"€"
)
for
_
,
eccn
:=
range
eccnList
{
//找到有对应的eccn,那么优先级肯定是最高的了
if
strings
.
Contains
(
sku
.
Eccn
,
eccn
)
{
for
_
,
eccn
:=
range
eccnList
{
break
if
strings
.
Contains
(
sku
.
Eccn
,
eccn
)
{
break
}
}
}
}
}
//如果没有设置品牌和商品,那么这个优先级高的就会覆盖下面的了,不需要再去判断品牌和型号了
//如果没有设置品牌和商品,那么这个优先级高的就会覆盖下面的了,不需要再去判断品牌和型号了
if
len
(
goodsNameList
)
==
0
&&
len
(
standardBrandIdList
)
==
0
&&
len
(
eccnList
)
==
0
{
break
break
}
}
}
}
}
sku
.
PriceRatio
=
priceRatioList
sku
.
PriceRatio
=
priceRatioList
...
...
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