#!/usr/bin/env python#-*- coding: utf-8 -*-
"""Create on ''
Update on ''
Author:guangxu.qi"""
importsys
reload(sys)
sys.setdefaultencoding('utf-8')
sys.path.append("/data/dp/dp_common/common/dbase")from myDbase importMysqlfrom myEngine importMyEngineimportdatetimeimportpandas as pd
lucrativ= Mysql("LUCRATIV")
lucrativ.getAll("set time_zone='PST8PDT'")defget_data(log_date):
sql= """SELECT user_id sales_id
,concat(uu.first_name,' ',uu.last_name) sales_name
,count(*) total_call
,count(distinct contact_id) contacted_prospect
,sum(case when bcr.status in ('both-completed','called-completed') then 1 else 0 end) success_call
,sum(case when bcr.status in ('both-completed','called-completed