Commit 6ad41f85 authored by 宋柯's avatar 宋柯

api_sub_tag替换api_tag

parent 00ed6533
......@@ -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:
......
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