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
184857c4
Commit
184857c4
authored
Feb 14, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
a1f618f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
22 deletions
+11
-22
auto_tips.py
search/utils/auto_tips.py
+11
-22
No files found.
search/utils/auto_tips.py
View file @
184857c4
...
...
@@ -277,32 +277,21 @@ def recommed_service_category_device_id(device_id):
'''
设备品类显示, 是否命中灰度
'''
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
device_id
in
[
"868771031984211"
,
"869412032478155"
]
:
return
2
if
not
device_id
:
return
1
elif
device_id
in
[
"F3F4C95F-BF76-4F82-9CC6-B5A8933A6BD9"
,
"867961030707277"
,
"0840E4C8-F6E4-4504-8812-D07049E86A25"
]:
return
3
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
# 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