Commit a9cffc17 authored by litaolemo's avatar litaolemo

update

parent d3e734e6
......@@ -7,7 +7,7 @@
import hashlib
import json
from meta_base_code.utils.func_get_uesr_event import get_user_event_from_mysql
import pymysql
import xlwt, datetime
import redis
......@@ -257,6 +257,8 @@ WHERE spam_pv.device_id IS NULL
print("-------------------------------")
count_not_has_portratit = 0
event_dict = {}
for count_user_count, res in enumerate(sql_res):
# print(count, res)
portratit_res = get_user_portrait_tag3_from_redis(res.device_id)
......@@ -274,8 +276,20 @@ WHERE spam_pv.device_id IS NULL
if portratit_res[demand]:
try:
for tag in portratit_res[demand][0:3]:
#temp
if tag == "美白针" or tag == "瘦脸针":
print(tag,res.device_id)
for event_cn,projects in get_user_event_from_mysql(res.device_id):
if event_cn not in event_dict:
event_dict[event_cn] = {}
project_list = projects.split(",")
for project in project_list:
if event_dict[event_cn].get(project):
event_dict[event_cn][project] += 1
else:
event_dict[event_cn][project] = 1
if tag in portrait_dict[demand]:
portrait_dict[demand][tag] += 1
else:
......@@ -294,7 +308,7 @@ WHERE spam_pv.device_id IS NULL
# print(portrait_dict)
# print(count_user_count + 1, count_not_has_portratit)
print("-------------------------------")
print("event_dict",event_dict)
for protratit_type in portrait_dict["projects"]:
partition_date = today_str
pid = hashlib.md5((partition_date + protratit_type).encode("utf8")).hexdigest()
......
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