Subversion Repositories SmartDukaan

Rev

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

Rev 23004 Rev 23006
Line 3403... Line 3403...
3403
    else:
3403
    else:
3404
        cursor = list(get_mongo_connection().Dtr.crmrefundwallet.find().skip(offset).limit(limit).sort("created_timestamp",-1))
3404
        cursor = list(get_mongo_connection().Dtr.crmrefundwallet.find().skip(offset).limit(limit).sort("created_timestamp",-1))
3405
    return cursor
3405
    return cursor
3406
 
3406
 
3407
def fetchProfitmandiBanners():
3407
def fetchProfitmandiBanners():
3408
    cursor = list(get_mongo_connection().Catalog.banners.find())
3408
    cursor = list(get_mongo_connection().Catalog.banners.find().sort("type",1).sort("rank", 1))
3409
    return cursor
3409
    return cursor
3410
 
3410
 
3411
def addProfitMandiBanner(data):
3411
def addProfitMandiBanner(data):
3412
    collection = get_mongo_connection().Catalog.banners()
3412
    collection = get_mongo_connection().Catalog.banners
3413
    fetched = list(collection.find({
3413
    fetched = list(collection.find({
3414
                     'rank':{'$gte':data['rank']}, 'type': data['type']
3414
                     'rank':{'$gte':data['rank']}, 'type': data['type']
3415
                    }))
3415
                    }))
3416
    if fetched:
3416
    if fetched:
3417
        for dict1 in fetched:
3417
        for dict1 in fetched:
Line 3419... Line 3419...
3419
            collection.save(dict1)
3419
            collection.save(dict1)
3420
    collection.insert(data)
3420
    collection.insert(data)
3421
    return True
3421
    return True
3422
 
3422
 
3423
def removeProfitmandiBanners(bannerId):
3423
def removeProfitmandiBanners(bannerId):
3424
    collection = get_mongo_connection().Catalog.banners()
3424
    collection = get_mongo_connection().Catalog.banners
-
 
3425
    print "bannerId", bannerId 
3425
    collection.remove({"_id":bannerId})
3426
    collection.remove({"_id":ObjectId(bannerId)})
3426
 
3427
 
3427
def fetchCrmRefundByBatchId(batchId):
3428
def fetchCrmRefundByBatchId(batchId):
3428
    cursor = get_mongo_connection().Dtr.crmrefundwallet.find_one({"batchId":int(batchId)})
3429
    cursor = get_mongo_connection().Dtr.crmrefundwallet.find_one({"batchId":int(batchId)})
3429
    return cursor
3430
    return cursor
3430
 
3431