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
6ad41f85
You need to sign in or sign up before continuing.
Commit
6ad41f85
authored
May 18, 2021
by
宋柯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api_sub_tag替换api_tag
parent
00ed6533
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
tool.py
eda/smart_rank/tool.py
+9
-9
No files found.
eda/smart_rank/tool.py
View file @
6ad41f85
...
...
@@ -117,7 +117,7 @@ def get_all_search_word_synonym_tags():
try
:
sql
=
"select a.keyword , c.id from api_wordrel a "
\
"left join api_wordrelsynonym b on a.id = b.wordrel_id "
\
"left join api_tag c on b.word=c.name "
\
"left join api_
sub_
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
,
"zx_str"
,
"ZXueX58pStrage"
,
"zhengxing"
,
sql
)
result_dict
=
dict
()
...
...
@@ -152,7 +152,7 @@ def get_all_synonym_tags():
:return:dict {"search_word1":[tag_list1],"search_word2":[tag_list2]...}
"""
try
:
sql
=
"select a.word, b.id from api_wordrelsynonym a left join api_tag b "
\
sql
=
"select a.word, b.id from api_wordrelsynonym a left join api_
sub_
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
,
"zx_str"
,
"ZXueX58pStrage"
,
"zhengxing"
,
sql
)
result_dict
=
dict
()
...
...
@@ -171,7 +171,7 @@ def get_all_api_tags():
:return:dict {"search_word1":[tag_list1],"search_word2":[tag_list2]...}
"""
try
:
sql
=
"select name, id from api_tag where tag_type in ('1', '2', '3', '5') and is_online=1"
sql
=
"select name, id from api_
sub_
tag where tag_type in ('1', '2', '3', '5') and is_online=1"
mysql_results
=
get_data_by_mysql
(
"172.16.30.141"
,
3306
,
"zx_str"
,
"ZXueX58pStrage"
,
"zhengxing"
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
...
...
@@ -199,7 +199,7 @@ def get_all_tag_tag_type():
:return:dict {tag_id1:tag_type1,tag_id2:tag_type2...}
"""
try
:
sql
=
"select id,tag_type from api_tag where tag_type+0<'4'+0 and is_online=1"
sql
=
"select id,tag_type from api_
sub_
tag where tag_type+0<'4'+0 and is_online=1"
mysql_results
=
get_data_by_mysql
(
"172.16.30.141"
,
3306
,
"zx_str"
,
"ZXueX58pStrage"
,
"zhengxing"
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
...
...
@@ -212,8 +212,8 @@ def get_all_tag_tag_type():
def
get_all_3tag_2tag
():
try
:
sql
=
"select a.child_id,a.parent_id from api_tagrelation a"
\
" 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) "
\
" left join api_
sub_
tag b on a.parent_id=b.id "
\
"where a.child_id in (select id from api_
sub_
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
,
"zx_str"
,
"ZXueX58pStrage"
,
"zhengxing"
,
sql
)
result_dict
=
dict
()
...
...
@@ -230,8 +230,8 @@ def get_all_3tag_2tag():
def
get_all_tag_parent_tag
():
try
:
sql
=
"select a.child_id,a.parent_id from api_tagrelation a"
\
" 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) "
\
" left join api_
sub_
tag b on a.parent_id=b.id "
\
"where a.child_id in (select id from api_
sub_
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
,
"zx_str"
,
"ZXueX58pStrage"
,
"zhengxing"
,
sql
)
result_dict
=
dict
()
...
...
@@ -247,7 +247,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"
sql
=
"select id, name from api_
sub_
tag where tag_type+0<'4'+0 and is_online=1"
mysql_results
=
get_data_by_mysql
(
"172.16.30.141"
,
3306
,
"zx_str"
,
"ZXueX58pStrage"
,
"zhengxing"
,
sql
)
result_dict
=
dict
()
for
data
in
mysql_results
:
...
...
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