Browse Source

mvp: 行为关联图标

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 years ago
parent
commit
6908db1348
1 changed files with 35 additions and 0 deletions
  1. 35 0
      mvp.py

+ 35 - 0
mvp.py

@@ -238,6 +238,29 @@ class Mvp:
             )
     '''
 
+    # 根据名称获取图标
+    sql_19 = '''
+        SELECT
+            id,
+            NAME
+        FROM
+            mvp_icon
+        WHERE
+            NAME = '%s
+    '''
+
+    # 行为更新图标
+    sql_20 = '''
+        UPDATE mvp_crowd_info_behavior
+        SET icon_id = % s
+        WHERE
+            behavioral_interest = % s
+    '''
+
+    # 模块图标更新
+    sql_21 = '''
+    '''
+
     """
         数据debug SQL
         1:
@@ -419,6 +442,18 @@ class Mvp:
                     self.insert_score_to_db(result)
         print('{}数据关系完成...'.format(time.time()))
 
+    def update_icon(self):
+        """
+            更新行为对应图标
+        :return:
+        """
+        icons = self.linshi_db.select(self.sql_19)
+        for ic in icons:
+            id = ic[0]
+            name = ic[1]
+            self.linshi_db.update(self.sql_20, [id, name])
+        pass
+
     def insert_score_to_db(self, scores):
         """
             行为、模块分数写入数据库