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
9e3b445b
Commit
9e3b445b
authored
Jul 21, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update db
parent
763a67e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
tag3_update_user_portrait_offline.py
eda/smart_rank/tag3_update_user_portrait_offline.py
+2
-2
tool.py
eda/smart_rank/tool.py
+8
-8
No files found.
eda/smart_rank/tag3_update_user_portrait_offline.py
View file @
9e3b445b
...
...
@@ -70,8 +70,8 @@ def _get_all_by_project(name):
where api_tag.name = '{}')
"""
.
format
(
name
)
zhengxing_conn
=
pymysql
.
connect
(
host
=
"172.16.30.141"
,
user
=
"
work
"
,
password
=
"
BJQaT9VzDcuPBqkd
"
,
user
=
"
zx_str
"
,
password
=
"
ZXueX58pStrage
"
,
database
=
"zhengxing"
,
charset
=
"utf8"
)
zhengxing_cursor
=
zhengxing_conn
.
cursor
()
...
...
eda/smart_rank/tool.py
View file @
9e3b445b
...
...
@@ -90,7 +90,7 @@ def get_all_search_word_synonym_tags():
"left join api_wordrelsynonym b on a.id = b.wordrel_id "
\
"left join api_tag c on b.word=c.name "
\
"where c.tag_type+0<'4'+0 and c.is_online=1"
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
work'
,
'BJQaT9VzDcuPBqkd
'
,
'zhengxing'
,
sql
)
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
zx_str'
,
'ZXueX58pStrage
'
,
'zhengxing'
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
if
data
[
'keyword'
]
not
in
result_dict
:
...
...
@@ -106,7 +106,7 @@ def get_all_word_synonym_words():
try
:
sql
=
"select a.keyword, b.word from api_wordrel a "
\
"left join api_wordrelsynonym b on a.id = b.wordrel_id "
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
work'
,
'BJQaT9VzDcuPBqkd
'
,
'zhengxing'
,
sql
)
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
zx_str'
,
'ZXueX58pStrage
'
,
'zhengxing'
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
if
data
[
'keyword'
]
not
in
result_dict
:
...
...
@@ -125,7 +125,7 @@ def get_all_synonym_tags():
try
:
sql
=
"select a.word, b.id from api_wordrelsynonym a left join api_tag b "
\
"on a.word=b.name where b.tag_type+0<'4'+0 and b.is_online=1"
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
work'
,
'BJQaT9VzDcuPBqkd
'
,
'zhengxing'
,
sql
)
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
zx_str'
,
'ZXueX58pStrage
'
,
'zhengxing'
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
if
data
[
'word'
]
not
in
result_dict
:
...
...
@@ -143,7 +143,7 @@ def get_all_api_tags():
"""
try
:
sql
=
"select name, id from api_tag where tag_type in ('1', '2', '3', '5') and is_online=1"
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
work'
,
'BJQaT9VzDcuPBqkd
'
,
'zhengxing'
,
sql
)
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
zx_str'
,
'ZXueX58pStrage
'
,
'zhengxing'
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
if
data
[
'name'
]
not
in
result_dict
:
...
...
@@ -171,7 +171,7 @@ def get_all_tag_tag_type():
"""
try
:
sql
=
"select id,tag_type from api_tag where tag_type+0<'4'+0 and is_online=1"
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
work'
,
'BJQaT9VzDcuPBqkd
'
,
'zhengxing'
,
sql
)
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
zx_str'
,
'ZXueX58pStrage
'
,
'zhengxing'
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
result_dict
[
data
[
'id'
]]
=
data
[
'tag_type'
]
...
...
@@ -186,7 +186,7 @@ def get_all_3tag_2tag():
" left join api_tag b on a.parent_id=b.id "
\
"where a.child_id in (select id from api_tag where tag_type='3' and is_online=1) "
\
"and b.tag_type='2' and b.is_online=1"
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
work'
,
'BJQaT9VzDcuPBqkd
'
,
'zhengxing'
,
sql
)
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
zx_str'
,
'ZXueX58pStrage
'
,
'zhengxing'
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
if
data
[
'child_id'
]
not
in
result_dict
:
...
...
@@ -204,7 +204,7 @@ def get_all_tag_parent_tag():
" left join api_tag b on a.parent_id=b.id "
\
"where a.child_id in (select id from api_tag where tag_type+0<'4'+0 and is_online=1) "
\
"and b.tag_type+0<'4'+0 and b.is_online=1"
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
work'
,
'BJQaT9VzDcuPBqkd
'
,
'zhengxing'
,
sql
)
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
zx_str'
,
'ZXueX58pStrage
'
,
'zhengxing'
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
if
data
[
'child_id'
]
not
in
result_dict
:
...
...
@@ -219,7 +219,7 @@ def get_all_tag_parent_tag():
def
get_all_tags_name
():
try
:
sql
=
"select id, name from api_tag where tag_type+0<'4'+0 and is_online=1"
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
work'
,
'BJQaT9VzDcuPBqkd
'
,
'zhengxing'
,
sql
)
mysql_results
=
get_data_by_mysql
(
'172.16.30.141'
,
3306
,
'
zx_str'
,
'ZXueX58pStrage
'
,
'zhengxing'
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
result_dict
[
data
[
'id'
]]
=
data
[
'name'
]
...
...
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