Commit dfff527d authored by lixiaofang's avatar lixiaofang

add

parent 9822f668
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment