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
b4d186e5
authored
Jun 09, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
e5b95d4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
internal/logic/match.go
internal/logic/match.go
View file @
b4d186e5
...
...
@@ -168,17 +168,26 @@ func getUpdateGoodsData(bomId int, bomItems []model.BomItem, deliveryType, sort
var
ziyingGoodsMapList
[]
GoodsMap
//如果是大陆收货(type=1),就要包含专卖,其中自营单独查
if
deliveryType
==
1
{
//先去自营查一遍
ziyingGoodsMapList
,
err
=
search
(
"liexin_ziying"
,
bomId
,
bomItems
,
deliveryType
,
sort
,
client
,
rawSearch
)
if
err
!=
nil
{
return
nil
,
err
//如果是综合排序(sort=1)
if
sort
==
1
{
//先去自营查一遍
ziyingGoodsMapList
,
err
=
search
(
"liexin_ziying"
,
bomId
,
bomItems
,
deliveryType
,
sort
,
client
,
rawSearch
)
if
err
!=
nil
{
return
nil
,
err
}
index
=
index
+
",zhuanmai"
//查完以后去除已经匹配的自营商品,然后去搜索联营的商品
bomItems
=
removeZiyingMatchBomItem
(
ziyingGoodsMapList
,
bomItems
)
lianyingGoodsMapList
,
_
:=
search
(
index
,
bomId
,
bomItems
,
deliveryType
,
sort
,
client
,
rawSearch
)
goodsMapList
=
append
(
ziyingGoodsMapList
,
lianyingGoodsMapList
...
)
}
else
{
index
=
index
+
",zhuanmai,liexin_ziying"
goodsMapList
,
err
=
search
(
index
,
bomId
,
bomItems
,
deliveryType
,
sort
,
client
,
rawSearch
)
if
err
!=
nil
{
return
nil
,
err
}
}
index
=
index
+
",zhuanmai"
}
//查完以后去除已经匹配的自营商品,然后去搜索联营的商品
bomItems
=
removeZiyingMatchBomItem
(
ziyingGoodsMapList
,
bomItems
)
lianyingGoodsMapList
,
_
:=
search
(
index
,
bomId
,
bomItems
,
deliveryType
,
sort
,
client
,
rawSearch
)
goodsMapList
=
append
(
ziyingGoodsMapList
,
lianyingGoodsMapList
...
)
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