Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
search_tips
Commits
dfff527d
Commit
dfff527d
authored
Feb 11, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
9822f668
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
auto_tips.py
search/utils/auto_tips.py
+23
-15
No files found.
search/utils/auto_tips.py
View file @
dfff527d
...
...
@@ -265,24 +265,32 @@ def get_query_by_es(query='', lat=0, lng=0, size=0, offset=0, highlight_query=No
def
recommed_service_category_device_id
(
device_id
):
try
:
'''
设备品类显示, 是否命中灰度
'''
categroy_select_cary1
=
[
"0"
,
"1"
,
"2"
,
"3"
,
"c"
,
"d"
,
"e"
,
"f"
]
categroy_select_cary2
=
[
"4"
,
"5"
,
"6"
,
"a"
]
categroy_select_cary3
=
[
"9"
,
"8"
,
"7"
,
"b"
]
if
not
device_id
:
return
1
hd_id
=
hashlib
.
md5
(
str
(
device_id
)
.
encode
())
.
hexdigest
()
is_gray
=
hd_id
[
-
1
]
if
is_gray
in
categroy_select_cary2
:
if
device_id
==
"868771031984211"
:
return
2
elif
is_gray
in
categroy_select_cary3
:
elif
device_id
==
"867961030707277"
:
return
3
else
:
return
1
'''
设备品类显示, 是否命中灰度
'''
# categroy_select_cary1 = ["0", "1", "2", "3", "c", "d", "e", "f"]
# categroy_select_cary2 = ["4", "5", "6", "a"]
# categroy_select_cary3 = ["9", "8", "7", "b"]
#
# if not device_id:
# return 1
#
# hd_id = hashlib.md5(str(device_id).encode()).hexdigest()
# is_gray = hd_id[-1]
#
# if is_gray in categroy_select_cary2:
# return 2
# elif is_gray in categroy_select_cary3:
# return 3
# else:
# return 1
except
:
return
1
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