| Line 281... |
Line 281... |
| 281 |
JOIN users u ON u.id = s.user_id WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR u.utm_campaign is not NULL) AND u.activated =1
|
281 |
JOIN users u ON u.id = s.user_id WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR u.utm_campaign is not NULL) AND u.activated =1
|
| 282 |
AND date(s.created) >=%s
|
282 |
AND date(s.created) >=%s
|
| 283 |
GROUP by week(s.created)
|
283 |
GROUP by week(s.created)
|
| 284 |
order by week(s.created);
|
284 |
order by week(s.created);
|
| 285 |
"""
|
285 |
"""
|
| - |
|
286 |
|
| 286 |
WVOL_QUERY="""
|
287 |
WVOL_QUERY="""
|
| 287 |
SELECT sum(quantity),sum(amount_paid) FROM allorder o
|
288 |
select sum(quantity), sum(value) from
|
| - |
|
289 |
(SELECT WEEK(date(o.created_on)) as weekid, sum(quantity) as quantity,sum(amount_paid) as value
|
| 288 |
JOIN users u ON u.id = o.user_id WHERE (LOWER(u.referrer) NOT LIKE
|
290 |
FROM allorder o JOIN users u ON u.id = o.user_id WHERE
|
| - |
|
291 |
(LOWER(u.referrer) NOT LIKE 'emp%%' OR u.utm_campaign is not NULL)
|
| - |
|
292 |
AND u.activated =1 AND date(o.created_on) >= %s
|
| - |
|
293 |
GROUP BY WEEK(date(o.created_on)) UNION
|
| - |
|
294 |
select WEEK(date(o.created)) as weekid,sum(quantity) as bquantity,sum(price)
|
| - |
|
295 |
from flipkartorders o JOIN users u ON u.id = o.user_id
|
| 289 |
'emp%%' OR u.utm_campaign is not NULL) AND u.activated =1
|
296 |
WHERE (LOWER(u.referrer) NOT LIKE 'emp%%' OR u.utm_campaign is not NULL) AND
|
| 290 |
AND date(o.created_on) >= %s GROUP BY WEEK(date(o.created_on));
|
297 |
u.activated =1 AND date(o.created) >= %s GROUP BY WEEK(date(o.created))) a group by weekid;"""
|
| 291 |
"""
|
- |
|
| 292 |
WOWN_QUERY="""
|
298 |
WOWN_QUERY="""
|
| 293 |
SELECT sum(quantity),sum(amount_paid) FROM allorder o
|
299 |
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
|
300 |
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
|
301 |
'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 WEEK(date(o.created_on));
|
302 |
AND date(o.created_on) >= %s and store_id='spice' GROUP BY WEEK(date(o.created_on));
|
| Line 728... |
Line 734... |
| 728 |
for data in r :
|
734 |
for data in r :
|
| 729 |
worksheet.write(row, column, int(data) if type(data) is float else data, date_format if type(data) is date else default_format)
|
735 |
worksheet.write(row, column, int(data) if type(data) is float else data, date_format if type(data) is date else default_format)
|
| 730 |
column += 1
|
736 |
column += 1
|
| 731 |
|
737 |
|
| 732 |
row = 0
|
738 |
row = 0
|
| 733 |
cursor.execute(wvolSql,(cutOffDate))
|
739 |
cursor.execute(wvolSql,(cutOffDate,cutOffDate))
|
| 734 |
result = cursor.fetchall()
|
740 |
result = cursor.fetchall()
|
| 735 |
|
741 |
|
| 736 |
for r in result:
|
742 |
for r in result:
|
| 737 |
row += 1
|
743 |
row += 1
|
| 738 |
column = 6
|
744 |
column = 6
|
| Line 1081... |
Line 1087... |
| 1081 |
|
1087 |
|
| 1082 |
def main():
|
1088 |
def main():
|
| 1083 |
populateYesterdayActiveUsers(24)
|
1089 |
populateYesterdayActiveUsers(24)
|
| 1084 |
populateValidOrders()
|
1090 |
populateValidOrders()
|
| 1085 |
populateOrderMap()
|
1091 |
populateOrderMap()
|
| 1086 |
populateWeekWiseMap1()
|
1092 |
#populateWeekWiseMap1()
|
| 1087 |
populateMonthWiseMap1()
|
1093 |
populateMonthWiseMap1()
|
| 1088 |
populateSaholicOrderMap()
|
1094 |
populateSaholicOrderMap()
|
| 1089 |
populateSaholicWeekWiseMap1()
|
1095 |
#populateSaholicWeekWiseMap1()
|
| 1090 |
populateSaholicMonthWiseMap1()
|
1096 |
populateSaholicMonthWiseMap1()
|
| 1091 |
generateDailyReport()
|
1097 |
generateDailyReport()
|
| 1092 |
generateWeeklyReport()
|
1098 |
generateWeeklyReport()
|
| 1093 |
generateMonthlyReport()
|
1099 |
generateMonthlyReport()
|
| 1094 |
sendmail(["manas.kapoor@shop2020.in","rajneesh.arora@saholic.com", "amit.gupta@shop2020.in","chaitnaya.vats@shop2020.in"], "", TMP_FILE, SUBJECT)
|
1100 |
sendmail(["manas.kapoor@shop2020.in","rajneesh.arora@saholic.com", "amit.gupta@shop2020.in","chaitnaya.vats@shop2020.in"], "", TMP_FILE, SUBJECT)
|
| 1095 |
#sendmail(["manas.kapoor@shop2020.in"], "", TMP_FILE, SUBJECT)
|
1101 |
#sendmail(["manas.kapoor@shop2020.in"], "", TMP_FILE, SUBJECT)
|
| 1096 |
|
1102 |
|
| 1097 |
|
1103 |
|
| 1098 |
def to_x_date(java_timestamp):
|
1104 |
def to_x_date(java_timestamp):
|
| 1099 |
try:
|
1105 |
try:
|
| 1100 |
date = datetime.fromtimestamp(java_timestamp / 1e3)
|
1106 |
date = datetime.fromtimestamp(java_timestamp / 1e3)
|
| 1101 |
except:
|
1107 |
except:
|
| 1102 |
return None
|
1108 |
return None
|