Subversion Repositories SmartDukaan

Rev

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

Rev 14599 Rev 14609
Line 240... Line 240...
240
    skip = (page-1)*window
240
    skip = (page-1)*window
241
    
241
    
242
    if userId is not None:
242
    if userId is not None:
243
        searchMap['userId'] = userId
243
        searchMap['userId'] = userId
244
    collection = get_mongo_connection().Dtr.merchantOrder
244
    collection = get_mongo_connection().Dtr.merchantOrder
245
    cursor = collection.find(searchMap).sort("_id",-1)
245
    cursor = collection.find(searchMap).sort("orderId",-1)
246
    total_count = cursor.count()
246
    total_count = cursor.count()
247
    pages = total_count/window + (0 if total_count%window==0 else 1)  
247
    pages = total_count/window + (0 if total_count%window==0 else 1)  
248
    print "total_count", total_count
248
    print "total_count", total_count
249
    if total_count > skip:
249
    if total_count > skip:
250
        cursor = cursor.skip(skip).limit(window)
250
        cursor = cursor.skip(skip).limit(window)