Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_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
2e8f77e7
authored
Jul 02, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
排除品牌方法
parent
260a37e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
model/brand.go
model/brand.go
0 → 100644
View file @
2e8f77e7
package
model
import
(
"search_server/pkg/config"
)
//获取需要排除的品牌id
//branType = 1 : 联营 2 : 自营
func
GetExcludeBrandIds
(
brandType
int
)
(
excludeBrandIds
[]
int
)
{
isNoTi
:=
config
.
Get
(
"brand.is_not_ti"
)
.
String
()
//如果关闭,直接返回空数据
if
isNoTi
==
"1"
{
return
}
//返回联营的brand_id切片
if
brandType
==
1
{
tiLyBrandIds
:=
config
.
Get
(
"brand.ti_ly_brand_ids"
)
.
Ints
(
","
)
excludeBrandIds
=
tiLyBrandIds
//获取的是字符串
return
}
//返回自营的ti的brand_id切片
tiZyBrandId
:=
config
.
Get
(
"brand.ti_zy_brand_ids"
)
.
Ints
(
","
)
excludeBrandIds
=
tiZyBrandId
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