Subversion Repositories SmartDukaan

Rev

Rev 2122 | Rev 2160 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2122 Rev 2132
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
 
2
 
3
DATE=`date +%Y-%b-%d`
3
DATE=`date +%Y-%b-%d`
4
mysql -uroot -pshop2020 user -e "SELECT u.email, u.communication_email, c.coupon_code, c.total_price, c.discounted_price FROM user u, cart c WHERE u.active_cart_id = c.id AND (c.coupon_code='SAHOLIC5' OR c.coupon_code='SAHOLIC1500');" > carts_with_coupon.${DATE}.csv
4
mysql -uroot -pshop2020 user -e "SELECT u.email, u.communication_email, c.coupon_code, c.total_price, c.discounted_price FROM user u, cart c WHERE u.active_cart_id = c.id AND (c.coupon_code='SAHOLIC5' OR c.coupon_code='SAHOLIC1500');" > carts_with_coupon.${DATE}.csv
5
mysql -uroot -pshop2020 user -e "SELECT u.email, u.communication_email, pt.coupon_code, pt.transaction_id, pt.applied_on FROM promotiontracker pt, user u WHERE u.id = pt.user_id" > orders_with_coupon.${DATE}.csv
5
mysql -uroot -pshop2020 user -e "SELECT o.id AS order_id, u.email, u.communication_email, pt.coupon_code, pt.transaction_id, pt.applied_on FROM user.promotiontracker pt, user.user u, transaction.order o WHERE u.id = pt.user_id AND o.transaction_id = pt.transaction_id;" > orders_with_coupon.${DATE}.csv
6
 
6
 
7
#Email the two report files.
7
#Email the two report files.
8
python ../PyProj/src/shop2020/utils/EmailAttachmentSender.py -tvarun.gupta@shop2020.in -s"Daily Promotion Update - Carts" -a carts_with_coupon.${DATE}.csv
8
python ../PyProj/src/shop2020/utils/EmailAttachmentSender.py -tvarun.gupta@shop2020.in -s"Daily Promotion Update - Carts" -a carts_with_coupon.${DATE}.csv
9
python ../PyProj/src/shop2020/utils/EmailAttachmentSender.py -tvarun.gupta@shop2020.in -s"Daily Promotion Update - Orders" -a orders_with_coupon.${DATE}.csv
9
python ../PyProj/src/shop2020/utils/EmailAttachmentSender.py -tvarun.gupta@shop2020.in -s"Daily Promotion Update - Orders" -a orders_with_coupon.${DATE}.csv