Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
meta_base_code
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
宋柯
meta_base_code
Commits
a9cffc17
Commit
a9cffc17
authored
Nov 25, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d3e734e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
new_user_project_protratit.py
new_user_analysis/new_user_project_protratit.py
+16
-2
No files found.
new_user_analysis/new_user_project_protratit.py
View file @
a9cffc17
...
...
@@ -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
()
...
...
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