示例#1
0
文件: models.py 项目: chichu/gamecard
 def card_out_yesterday(self):
     from gamecard.utils.dbutils import get_mongodb_collect
     from gamecard.utils.strutils import get_collect_name
     collect = get_mongodb_collect(get_collect_name(self.item.id))
     start = datetime.now() - timedelta(days=1) 
     end  = datetime.now()
     card_out = collect.find({"status":'used',"get_time":{"$gt":start,"$lt":end}}).count()
     return card_out
示例#2
0
文件: models.py 项目: chichu/gamecard
 def card_left(self):
     from gamecard.utils.dbutils import get_mongodb_collect
     from gamecard.utils.strutils import get_collect_name
     collect = get_mongodb_collect(get_collect_name(self.item.id))
     left_now = collect.find({"status":'normal'}).count()
     return left_now