ck hace 4 años
padre
commit
748d36b4f8
Se han modificado 3 ficheros con 47 adiciones y 1 borrados
  1. 1 1
      data_manage/public_analysis.py
  2. 42 0
      handlers/AnalysisHandler.py
  3. 4 0
      urls.py

+ 1 - 1
data_manage/public_analysis.py

@@ -401,7 +401,7 @@ def boss_panel_summary(user_id,start,end,channel,pitcher, type, stage, page, pag
     op3 = f" and dt<='{end}' " if end else ''
     op4 = f" and type='{type}' " if type else ''
     op5= f" and stage='{stage}' " if stage else ''
-    op6 = f" and channel='{channel}' " if stage else ''
+    op6 = f" and channel='{channel}' " if channel else ''
     op7 = f" order by {order_by} {order}" if order_by and order else 'order by dt desc'
 
     dm = MysqlUtils().dm

+ 42 - 0
handlers/AnalysisHandler.py

@@ -0,0 +1,42 @@
+from handlers.HandlerBase import BaseHandler
+from model.DataBaseUtils import MysqlUtils
+import json
+import requests
+from data_manage.operate import *
+from model.DataBaseUtils import MysqlUtils
+db = MysqlUtils()
+
+
+class ChannelAnalysisHandler(BaseHandler):
+    APP_MAP = {
+        "user_channel": user_channel,
+
+    }
+
+
+    def post(self):
+
+        arg = self.get_args()
+        print(arg)
+        try:
+            data = self.run(arg)
+
+            self.write_json(data=data)
+        except Exception as e:
+            print(e)
+            self.write_fail()
+
+    def run(self, arg):
+
+        app = self.request.full_url().split('/')[-1]
+        return self.run_function(self.APP_MAP[app], arg)
+
+    def run_function(self, func, arg):
+        return func(arg)
+
+
+
+
+
+
+

+ 4 - 0
urls.py

@@ -4,6 +4,7 @@ from handlers.GitHookHandler import *
 from handlers.PublicAnalysisHandler import *
 from handlers.TaskHandler import *
 from handlers import OperateHandler
+from handlers import AnalysisHandler
 
 
 urls = [
@@ -51,6 +52,9 @@ urls = [
     # CRUD
     (r'/operate/channel_group.*', OperateHandler.ChannelGroupHandler),  # 公众号分组设置
 
+    # 自助分析
+    (r'/data/analysis.*', AnalysisHandler.ChannelAnalysisHandler),  # 公众号分组设置
+
 
 
 ]