Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
3bf6fd82
Commit
3bf6fd82
authored
Jun 04, 2020
by
任婷婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fb0d392c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
tag3_update_user_portrait_offline.py
eda/smart_rank/tag3_update_user_portrait_offline.py
+5
-4
tool.py
eda/smart_rank/tool.py
+7
-4
No files found.
eda/smart_rank/tag3_update_user_portrait_offline.py
View file @
3bf6fd82
...
@@ -132,7 +132,7 @@ def update_tag3_user_portrait(cl_id):
...
@@ -132,7 +132,7 @@ def update_tag3_user_portrait(cl_id):
second_positions
=
values
[
item
]
.
get
(
"second_positions"
,
[])
second_positions
=
values
[
item
]
.
get
(
"second_positions"
,
[])
second_solutions
=
values
[
item
]
.
get
(
"second_solutions"
,
[])
second_solutions
=
values
[
item
]
.
get
(
"second_solutions"
,
[])
projects
=
values
[
item
]
.
get
(
"projects"
,
[])
projects
=
values
[
item
]
.
get
(
"projects"
,
[])
score
s
=
values
[
item
]
.
get
(
"score"
,[]
)
score
=
values
[
item
]
.
get
(
"score"
,
0
)
first_solutions
=
[
i
for
i
in
first_solutions
if
i
!=
''
]
first_solutions
=
[
i
for
i
in
first_solutions
if
i
!=
''
]
second_solutions
=
[
i
for
i
in
second_solutions
if
i
!=
''
]
second_solutions
=
[
i
for
i
in
second_solutions
if
i
!=
''
]
...
@@ -141,15 +141,16 @@ def update_tag3_user_portrait(cl_id):
...
@@ -141,15 +141,16 @@ def update_tag3_user_portrait(cl_id):
first_positions
=
[
i
for
i
in
first_positions
if
i
!=
''
]
first_positions
=
[
i
for
i
in
first_positions
if
i
!=
''
]
second_positions
=
[
i
for
i
in
second_positions
if
i
!=
''
]
second_positions
=
[
i
for
i
in
second_positions
if
i
!=
''
]
projects
=
[
i
for
i
in
projects
if
i
!=
''
]
projects
=
[
i
for
i
in
projects
if
i
!=
''
]
scores
=
[
scores
]
write_user_portrait_action_divided
(
cl_id
=
cl_id_single
,
event_cn
=
item
,
first_solutions
=
set
(
first_solutions
),
write_user_portrait_action_divided
(
cl_id
=
cl_id_single
,
event_cn
=
item
,
score
=
score
,
first_solutions
=
set
(
first_solutions
),
first_positions
=
set
(
first_positions
),
first_positions
=
set
(
first_positions
),
first_demands
=
set
(
first_demands
),
first_demands
=
set
(
first_demands
),
second_demands
=
set
(
second_demands
),
second_demands
=
set
(
second_demands
),
second_positions
=
set
(
second_positions
),
second_positions
=
set
(
second_positions
),
second_solutions
=
set
(
second_solutions
),
second_solutions
=
set
(
second_solutions
),
projects
=
set
(
projects
),
scores
=
scores
)
projects
=
set
(
projects
),
)
return
cl_id
return
cl_id
...
...
eda/smart_rank/tool.py
View file @
3bf6fd82
...
@@ -524,7 +524,7 @@ def user_portrait_action_statistic(cl_id):
...
@@ -524,7 +524,7 @@ def user_portrait_action_statistic(cl_id):
# CREATE TABLE `user_portrait_action_divided_score` (
# CREATE TABLE `user_portrait_action_divided_score` (
# `id` int(11) NOT NULL AUTO_INCREMENT,
# `id` int(11) NOT NULL AUTO_INCREMENT,
# `date` text NOT NULL,
# `date` text NOT NULL,
# `score`
text
NOT NULL,
# `score`
int(11)
NOT NULL,
# `cl_id` text NOT NULL,
# `cl_id` text NOT NULL,
# `first_solutions` text NOT NULL,
# `first_solutions` text NOT NULL,
# `second_solutions` text NOT NULL,
# `second_solutions` text NOT NULL,
...
@@ -536,14 +536,17 @@ def user_portrait_action_statistic(cl_id):
...
@@ -536,14 +536,17 @@ def user_portrait_action_statistic(cl_id):
# PRIMARY KEY(`id`)
# PRIMARY KEY(`id`)
# );
# );
def
write_user_portrait_action_divided
(
cl_id
,
event_cn
,
first_solutions
,
second_solutions
,
first_demands
,
second_demands
,
def
write_user_portrait_action_divided
(
cl_id
,
event_cn
,
score
,
first_solutions
,
second_solutions
,
first_demands
,
second_demands
,
first_positions
,
second_positions
,
projects
,
scores
):
first_positions
,
second_positions
,
projects
):
try
:
try
:
today
=
datetime
.
date
.
today
()
today
=
datetime
.
date
.
today
()
oneday
=
datetime
.
timedelta
(
days
=
1
)
oneday
=
datetime
.
timedelta
(
days
=
1
)
yesterday
=
today
-
oneday
yesterday
=
today
-
oneday
print
(
'
%
'
*
100
)
print
(
type
(
yesterday
))
print
(
type
(
score
))
sql
=
"""insert into user_portrait_action_divided_score values(null, '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}','{}','{}')"""
.
format
(
sql
=
"""insert into user_portrait_action_divided_score values(null, '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}','{}','{}')"""
.
format
(
yesterday
,
s
tr
(
scores
)
,
cl_id
,
event_cn
,
","
.
join
(
first_solutions
),
","
.
join
(
second_solutions
),
","
.
join
(
first_demands
),
yesterday
,
s
core
,
cl_id
,
event_cn
,
","
.
join
(
first_solutions
),
","
.
join
(
second_solutions
),
","
.
join
(
first_demands
),
","
.
join
(
second_demands
),
","
.
join
(
first_positions
),
","
.
join
(
second_positions
),
","
.
join
(
projects
))
","
.
join
(
second_demands
),
","
.
join
(
first_positions
),
","
.
join
(
second_positions
),
","
.
join
(
projects
))
db
,
cursor
=
connect_mysql
()
db
,
cursor
=
connect_mysql
()
...
...
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