Commit 49dda3e6 authored by litaolemo's avatar litaolemo

update

parent a9cffc17
......@@ -4,12 +4,6 @@
# @email : litao@igengmei.com
# @author : litao
# -*- coding:UTF-8 -*-
# @Time : 2020/9/4 17:07
# @File : search_meigou_ctr.py
# @email : litao@igengmei.com
# @author : litao
import hashlib
import json
......
......@@ -185,7 +185,6 @@ for t in range(0, task_days):
AND action = 'on_click_card'
AND params['card_type'] = 'highlight_word'
) click
LEFT JOIN
(
select distinct device_id
......
# -*- coding:UTF-8 -*-
# @Time : 2020/11/25 10:51
# @File : func_get_uesr_event.py
# @email : litao@igengmei.com
# @author : litao
import pymysql
def con_sql(sql):
# 从数据库的表里获取数据
# db = pymysql.connect(host='172.16.40.158', port=4000, user='st_user', passwd='aqpuBLYzEV7tML5RPsN1pntUzFy',
# db='jerry_prod')
db = pymysql.connect(host='172.16.30.136', port=3306, user='doris', passwd='o5gbA27hXHHm',
db='doris_prod')
cursor = db.cursor()
cursor.execute(sql)
result = cursor.fetchall()
db.close()
return result
def get_user_event_from_mysql(keyword):
sql_str = """select cl_id, from_unixtime(log_time) as date, event_cn, projects from kafka_tag3_log
where cl_id = '%s' order by date desc""" % keyword
sql_result = con_sql(sql_str)
for data in sql_result:
clid,date,event_cn,projects = sql_result
yield event_cn,projects
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