Subversion Repositories SmartDukaan

Rev

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

Rev 14668 Rev 14670
Line 295... Line 295...
295
    print type(userId)
295
    print type(userId)
296
    result = get_mongo_connection().Dtr.merchantOrder\
296
    result = get_mongo_connection().Dtr.merchantOrder\
297
        .aggregate([
297
        .aggregate([
298
                    {'$match':{'subOrders.cashBackStatus':Store.CB_APPROVED, 'userId':userId}},
298
                    {'$match':{'subOrders.cashBackStatus':Store.CB_APPROVED, 'userId':userId}},
299
                    {'$unwind':"$subOrders"},
299
                    {'$unwind':"$subOrders"},
-
 
300
                    {'$match':{'subOrders.cashBackStatus':Store.CB_APPROVED}},
300
                    { 
301
                    { 
301
                     '$group':{
302
                     '$group':{
302
                               '_id':None,
303
                               '_id':None,
303
                               'amount': { '$sum':'$subOrders.cashBackAmount'},
304
                               'amount': { '$sum':'$subOrders.cashBackAmount'},
304
                               }
305
                               }