Go to most recent revision |
Details |
Last modification |
View Log
| RSS feed
| Rev |
Author |
Line No. |
Line |
| 2121 |
varun.gupt |
1 |
'''
|
|
|
2 |
Created on 08-Jun-2011
|
|
|
3 |
|
|
|
4 |
@author: varungupta
|
|
|
5 |
'''
|
|
|
6 |
from shop2020.model.v1.user.impl.Dataservice import Promotion, Coupon, PromotionTracker
|
|
|
7 |
from elixir import session
|
|
|
8 |
|
|
|
9 |
def get_coupon_usage_count_by_user(coupon_code, user_id):
|
|
|
10 |
return PromotionTracker.query.filter_by(coupon_code = coupon_code).filter_by(user_id = user_id).count()
|
|
|
11 |
|
|
|
12 |
def get_coupon_usage_count(coupon_code):
|
|
|
13 |
return PromotionTracker.query.filter_by(coupon_code = coupon_code).count()
|