Subversion Repositories SmartDukaan

Rev

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

Rev 14119 Rev 14120
Line 221... Line 221...
221
        #sku['totalPoints'] = sku['bestSellerPoints'] + sku['nlcPoints']
221
        #sku['totalPoints'] = sku['bestSellerPoints'] + sku['nlcPoints']
222
        get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'bestSellerPoints':sku['bestSellerPoints']}},multi=False)
222
        get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'bestSellerPoints':sku['bestSellerPoints']}},multi=False)
223
    
223
    
224
    for sku in allItems:
224
    for sku in allItems:
225
        deal_item = list(get_mongo_connection().Catalog.Deals.find({'skuBundleId':sku['skuBundleId']}).sort('bestSellerPoints',pymongo.DESCENDING).limit(1))
225
        deal_item = list(get_mongo_connection().Catalog.Deals.find({'skuBundleId':sku['skuBundleId']}).sort('bestSellerPoints',pymongo.DESCENDING).limit(1))
-
 
226
        if sku['source_id'] == 4:
226
        if sku['source_id'] == 4 and deal_item[0]['source_id']!=4:
227
            if deal_item[0]['source_id']!=4:
227
            weight = .2
228
                weight = .2
-
 
229
            else:
-
 
230
                weight = 1
228
        else:
231
        else:
-
 
232
            if deal_item[0]['source_id']==4:
-
 
233
                weight = 5
-
 
234
            else:    
229
            weight = 1
235
                weight = 1
230
        if deal_item[0]['bestSellerPoints'] > 0:
236
        if deal_item[0]['bestSellerPoints'] > 0:
231
            sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints'] * weight
237
            sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints'] * weight
232
        else:
238
        else:
233
            sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints']
239
            sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints']
234
        
240