| Line 268... |
Line 268... |
| 268 |
GROUP by year(s.created),month(s.created)
|
268 |
GROUP by year(s.created),month(s.created)
|
| 269 |
order by year(s.created),month(s.created);
|
269 |
order by year(s.created),month(s.created);
|
| 270 |
"""
|
270 |
"""
|
| 271 |
|
271 |
|
| 272 |
MVOL_QUERY="""
|
272 |
MVOL_QUERY="""
|
| 273 |
select sum(quantity), sum(value) from (SELECT month(date(o.created_on)) as monthid,
|
273 |
select sum(quantity), sum(value) from (SELECT year(date(o.created_on)) as yearid,month(date(o.created_on)) as monthid,
|
| 274 |
sum(quantity) as quantity,sum(amount_paid) as value FROM allorder o
|
274 |
sum(quantity) as quantity,sum(amount_paid) as value FROM allorder o
|
| 275 |
JOIN users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR u.utm_campaign is not NULL)
|
275 |
JOIN users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR u.utm_campaign is not NULL)
|
| 276 |
AND u.activated =1 AND date(o.created_on) >=%s
|
276 |
AND u.activated =1 AND date(o.created_on) >=%s
|
| 277 |
GROUP BY month(date(o.created_on)) UNION
|
277 |
GROUP BY year(date(o.created_on)),month(date(o.created_on)) UNION
|
| 278 |
select month(date(o.created)) as monthid,sum(quantity) as bquantity,sum(price)
|
278 |
select year(date(o.created)) as yearid,month(date(o.created)) as monthid,sum(quantity) as bquantity,sum(price)
|
| 279 |
from flipkartorders o JOIN users u ON u.id = ifnull(o.user_id,139) WHERE (LOWER(u.referrer) NOT LIKE
|
279 |
from flipkartorders o JOIN users u ON u.id = ifnull(o.user_id,139) WHERE (LOWER(u.referrer) NOT LIKE
|
| 280 |
'emp%%' OR u.utm_campaign is not NULL) AND u.activated =1 AND date(o.created) >= %s
|
280 |
'emp%%' OR u.utm_campaign is not NULL) AND u.activated =1 AND date(o.created) >= %s
|
| 281 |
GROUP BY month(date(o.created))) a group by monthid;
|
281 |
GROUP BY year(date(o.created)),month(date(o.created))) a group by yearid,monthid;
|
| 282 |
"""
|
282 |
"""
|
| 283 |
|
283 |
|
| 284 |
MOWNO_QUERY="""
|
284 |
MOWNO_QUERY="""
|
| 285 |
SELECT month(created_on),count(distinct merchant_order_id) FROM allorder o
|
285 |
SELECT month(created_on),count(distinct merchant_order_id) FROM allorder o
|
| 286 |
JOIN users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR
|
286 |
JOIN users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR
|
| 287 |
u.utm_campaign is not NULL) AND u.activated =1 AND date(o.created_on) >=%s and store_id='spice'
|
287 |
u.utm_campaign is not NULL) AND u.activated =1 AND date(o.created_on) >=%s and store_id='spice'
|
| 288 |
GROUP BY month(o.created_on)
|
288 |
GROUP BY year(o.created_on),month(o.created_on)
|
| 289 |
order by month(o.created_on);
|
289 |
order by year(o.created_on),month(o.created_on);
|
| 290 |
"""
|
290 |
"""
|
| 291 |
|
291 |
|
| 292 |
MOWN_QUERY="""
|
292 |
MOWN_QUERY="""
|
| 293 |
SELECT sum(quantity),sum(amount_paid) FROM allorder o
|
293 |
SELECT sum(quantity),sum(amount_paid) FROM allorder o
|
| 294 |
JOIN users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE
|
294 |
JOIN users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE
|
| 295 |
'emp%%' OR u.utm_campaign is not NULL) AND u.activated =1
|
295 |
'emp%%' OR u.utm_campaign is not NULL) AND u.activated =1
|
| 296 |
AND date(o.created_on) >= %s and store_id='spice' GROUP BY month(date(o.created_on));
|
296 |
AND date(o.created_on) >= %s and store_id='spice'
|
| - |
|
297 |
GROUP BY year(date(o.created_on)),month(date(o.created_on));
|
| 297 |
"""
|
298 |
"""
|
| 298 |
MACCSB_QUERY="""
|
299 |
MACCSB_QUERY="""
|
| 299 |
select month(created_on),count(distinct user_id) from allorder
|
300 |
select month(created_on),count(distinct user_id) from allorder
|
| 300 |
where (category='Accessories' or category='Accs') and
|
301 |
where (category='Accessories' or category='Accs') and
|
| - |
|
302 |
date(created_on)>=%s and store_id='spice' group by
|
| 301 |
date(created_on)>=%s and store_id='spice' group by month(created_on) order by month(created_on);
|
303 |
year(created_on),month(created_on) order by year(created_on),month(created_on);
|
| 302 |
"""
|
304 |
"""
|
| 303 |
|
305 |
|
| 304 |
MACCSTO_QUERY="""
|
306 |
MACCSTO_QUERY="""
|
| 305 |
SELECT month(created_on),count(distinct merchant_order_id) FROM allorder o JOIN
|
307 |
SELECT month(created_on),count(distinct merchant_order_id) FROM allorder o JOIN
|
| 306 |
users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR u.utm_campaign is not NULL)
|
308 |
users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR u.utm_campaign is not NULL)
|
| 307 |
AND u.activated =1 AND date(o.created_on) >=%s and store_id='spice'
|
309 |
AND u.activated =1 AND date(o.created_on) >=%s and store_id='spice'
|
| 308 |
and (category='Accs' or category='Accessories') GROUP BY month(o.created_on)
|
310 |
and (category='Accs' or category='Accessories') GROUP BY year(o.created_on),month(o.created_on)
|
| 309 |
order by month(o.created_on);
|
311 |
order by year(o.created_on),month(o.created_on);
|
| 310 |
"""
|
312 |
"""
|
| 311 |
|
313 |
|
| 312 |
MACCSO_QUERY="""
|
314 |
MACCSO_QUERY="""
|
| 313 |
select month(created_on),sum(quantity),sum(amount_paid) from allorder
|
315 |
select month(created_on),sum(quantity),sum(amount_paid) from allorder
|
| 314 |
where (category='Accessories' or category='Accs') and date(created_on)>=%s and store_id='spice'
|
316 |
where (category='Accessories' or category='Accs') and date(created_on)>=%s and store_id='spice'
|
| 315 |
group by month(created_on) order by month(created_on);
|
317 |
group by year(created_on),month(created_on) order by year(created_on),month(created_on);
|
| 316 |
"""
|
318 |
"""
|
| 317 |
|
319 |
|
| 318 |
WNRU_QUERY="""
|
320 |
WNRU_QUERY="""
|
| 319 |
SELECT COUNT(*)
|
321 |
SELECT COUNT(*)
|
| 320 |
FROM users u WHERE
|
322 |
FROM users u WHERE
|