Subversion Repositories SmartDukaan

Rev

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

Rev 14120 Rev 14142
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:
-
 
227
            if deal_item[0]['source_id']!=4:
-
 
228
                weight = .2
-
 
229
            else:
-
 
230
                weight = 1
-
 
231
        else:
-
 
232
            if deal_item[0]['source_id']==4:
-
 
233
                weight = 5
-
 
234
            else:    
-
 
235
                weight = 1
-
 
236
        if deal_item[0]['bestSellerPoints'] > 0:
-
 
237
            sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints'] * weight
-
 
238
        else:
-
 
239
            sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints']
226
        sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints']
240
        
-
 
241
        sku['totalPoints'] = sku['catalogBestSellerPoints'] + sku['nlcPoints']
227
        sku['totalPoints'] = sku['catalogBestSellerPoints'] + sku['nlcPoints']
242
        get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'catalogBestSellerPoints':sku['catalogBestSellerPoints'],'totalPoints':sku['totalPoints']}},multi=False)
228
        get_mongo_connection().Catalog.Deals.update({'_id':sku['_id']},{'$set':{'catalogBestSellerPoints':sku['catalogBestSellerPoints'],'totalPoints':sku['totalPoints']}},multi=False)
243
        
229
        
244
 
230
 
245
def elimiateSimilarDeals():
231
def elimiateSimilarDeals():