Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
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
5f14a4d0
authored
Aug 17, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
数据处理
parent
cabea6c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
app/Http/Services/DataService.php
app/Http/Services/DataService.php
View file @
5f14a4d0
...
...
@@ -235,6 +235,30 @@ class DataService
}
}
//初始化供应商对应的搜索标签到redis
public
function
initSupplierSearchTags
()
{
//初始化所有正式服务器的标签情况到redis
$supplierModel
=
new
SupplierChannelModel
();
$suppliers
=
$supplierModel
->
where
(
'is_type'
,
0
)
->
get
()
->
toArray
();
$redis
=
new
RedisModel
();
foreach
(
$suppliers
as
$supplier
)
{
//1精选,2原厂直供,3认证,4猎芯自营,100无标签
$tagFlags
=
[];
//先去判断供应商性质是否为原厂,如果是的话,写入标签2
if
(
$supplier
[
'supplier_group'
]
==
4
)
{
$tagFlags
[]
=
2
;
}
if
(
$supplier
[
'has_certification'
]
==
1
)
{
$tagFlags
[]
=
3
;
}
$redis
->
hset
(
'supplier_search_tags'
,
$supplier
[
'supplier_code'
],
json_encode
([
'supplier_code'
=>
$supplier
[
'supplier_code'
],
'tags'
=>
$tagFlags
,
]));
}
}
}
...
...
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