| 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 |
weight = .2
|
227 |
weight = .2
|
| 228 |
else:
|
228 |
else:
|
| 229 |
weight = 1
|
229 |
weight = 1
|
| 230 |
if deal_item[0]['bestSellerPoints'] > 0:
|
230 |
if deal_item[0]['bestSellerPoints'] > 0:
|
| 231 |
sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints'] * weight
|
231 |
sku['catalogBestSellerPoints'] = deal_item[0]['bestSellerPoints'] * weight
|