Commit e0947c37 authored by 高雅喆's avatar 高雅喆

update

parent ccacd808
......@@ -116,6 +116,7 @@ if __name__ == '__main__':
# 获取昨天下单的用户设备id,下单的美购,美购对应的tag
# api_order只有用户的user_id,一个user_id对应多个device_id
# 用户一次可以下多个订单(美购),一个美购对应多个tag
my_today = str(datetime.date.today())
my_yesterday = str(datetime.date.today() - datetime.timedelta(days=1))
sql_order_device_info_yesterday = """
SELECT tmp1.user_id,
......@@ -145,13 +146,14 @@ if __name__ == '__main__':
LEFT JOIN api_tag f ON e.tag_id = f.id
WHERE d.status=1
AND d.pay_time>'{my_yesterday}'
AND f.tag_type+0 <'4'+0) tmp2
AND d.pay_time<'{today}'
AND f.tag_type+0 <'4'+0) tmp2
GROUP BY user_id) a
LEFT JOIN statistic_device_user b ON a.user_id = b.user_id) tmp
GROUP BY tmp.user_id) tmp1
LEFT JOIN statistic_device c ON tmp1.device_id_id = c.id
WHERE c.device_id IS NOT NULL
""".format(my_yesterday=my_yesterday)
""".format(my_yesterday=my_yesterday, today=my_today)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing',
sql_order_device_info_yesterday)
device_ids_lst = [i["device_id"] for i 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