| Line 45... |
Line 45... |
| 45 |
if(pp.user_id is null, 'FALSE', 'TRUE') as ppref, u.created ucreated, ua.last_active, ow.created, if(ow.total is null, 0, ow.total) as total,
|
45 |
if(pp.user_id is null, 'FALSE', 'TRUE') as ppref, u.created ucreated, ua.last_active, ow.created, if(ow.total is null, 0, ow.total) as total,
|
| 46 |
u.referrer,u.utm_campaign, u.utm_content, u.utm_term, u.utm_medium, u.utm_source, u.activated, r.id as retailer_id, r.status
|
46 |
u.referrer,u.utm_campaign, u.utm_content, u.utm_term, u.utm_medium, u.utm_source, u.activated, r.id as retailer_id, r.status
|
| 47 |
from users u left join useractive ua on ua.user_id=u.id left join usergroups ug on ug.id=u.usergroup_id
|
47 |
from users u left join useractive ua on ua.user_id=u.id left join usergroups ug on ug.id=u.usergroup_id
|
| 48 |
left join (select distinct user_id from price_preferences) pp on pp.user_id=u.id
|
48 |
left join (select distinct user_id from price_preferences) pp on pp.user_id=u.id
|
| 49 |
left join (select distinct user_id from brand_preferences) bp on bp.user_id=u.id
|
49 |
left join (select distinct user_id from brand_preferences) bp on bp.user_id=u.id
|
| 50 |
left join (select *, count(*) as total from (select user_id, created from order_view where status in ('ORDER_CREATED', 'DETAIL_CREATED') union select user_id, created from flipkartorders order by) as a1 group by user_id) as ow on ow.user_id = u.id order by created desc
|
50 |
left join (select *, count(*) as total from (select user_id, created from order_view where status in ('ORDER_CREATED', 'DETAIL_CREATED') union select user_id, created from flipkartorders order by created desc) as a1 group by user_id) as ow on ow.user_id = u.id
|
| 51 |
left join retailerlinks rl on rl.user_id=u.id left join retailers r on r.id=rl.retailer_id where lower(u.referrer) not like 'emp%' or u.referrer is null) final;
|
51 |
left join retailerlinks rl on rl.user_id=u.id left join retailers r on r.id=rl.retailer_id where lower(u.referrer) not like 'emp%' or u.referrer is null) final;
|
| 52 |
"""
|
52 |
"""
|
| 53 |
|
53 |
|
| 54 |
|
54 |
|
| 55 |
date_format = xlwt.XFStyle()
|
55 |
date_format = xlwt.XFStyle()
|