| Line 42... |
Line 42... |
| 42 |
) as x
|
42 |
) as x
|
| 43 |
|
43 |
|
| 44 |
"""
|
44 |
"""
|
| 45 |
|
45 |
|
| 46 |
USER_STORE_PRODUCT_VIEW="""
|
46 |
USER_STORE_PRODUCT_VIEW="""
|
| 47 |
SELECT u.user_id,count(u.id) AS count, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(u.url, '/', -1 ),'?',1),'%',1)
|
47 |
SELECT u.user_id,count(u.id) AS count, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(u.url, '/', -1 ),'?',1),'%',1),'#',1)
|
| 48 |
AS skuBundleId,"product_view" as source,(uw.weightage* count(u.id)) as weight
|
48 |
AS skuBundleId,"product_view" as source,(uw.weightage* count(u.id)) as weight
|
| 49 |
FROM user_urls u join user_segmentation_weigthage uw on "product_view"=uw.weightage_type
|
49 |
FROM user_urls u join user_segmentation_weigthage uw on "product_view"=uw.weightage_type
|
| 50 |
WHERE u.url LIKE '%store_products/view%' and u.user_id!=0 and
|
50 |
WHERE u.url LIKE '%store_products/view%' and u.user_id!=0 and
|
| 51 |
SUBSTRING_INDEX(SUBSTRING_INDEX(u.url, '/', -1 ),'?',1) not like ''
|
51 |
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(u.url, '/', -1 ),'?',1),'%',1),'#',1) not like ''
|
| 52 |
and datediff(curdate(),u.created)<7
|
52 |
and datediff(curdate(),u.created)<7
|
| 53 |
group by u.user_id,skuBundleId;
|
53 |
group by u.user_id,skuBundleId;
|
| 54 |
"""
|
54 |
"""
|
| 55 |
|
55 |
|
| 56 |
REPLACE_QUERY="""
|
56 |
REPLACE_QUERY="""
|