|
@@ -235,8 +235,20 @@ class CloudStorageView(View):
|
|
|
#是否促销
|
|
|
nowTime = int(time.time())
|
|
|
promotion = PromotionRuleModel.objects.filter(status=1, startTime__lte=nowTime,
|
|
|
- endTime__gte=nowTime).values('id','ruleConfig')
|
|
|
- is_promotion = 1 if promotion.exists() else 0
|
|
|
+ endTime__gte=nowTime).values('id','ruleConfig','ruleName',
|
|
|
+ 'startTime','endTime','ruleDesc')
|
|
|
+ if promotion.exists():
|
|
|
+ promotion = {
|
|
|
+ 'is_promotion': 1,
|
|
|
+ 'promotionStartTime': promotion[0]['startTime'],
|
|
|
+ 'promotionEndTime': promotion[0]['endTime'],
|
|
|
+ 'promotionName': json.loads(promotion[0]['ruleName']).get(lang, ''),
|
|
|
+ 'promotionDesc': json.loads(promotion[0]['ruleDesc']).get(lang, '')
|
|
|
+ }
|
|
|
+ else:
|
|
|
+ promotion = {
|
|
|
+ 'is_promotion': 0
|
|
|
+ }
|
|
|
result = {
|
|
|
'meals': res,
|
|
|
'extra':
|
|
@@ -244,7 +256,7 @@ class CloudStorageView(View):
|
|
|
'cloud_banner': SERVER_DOMAIN+'web/images/cloud_cn_banner.png',
|
|
|
'cloud_en_baner': SERVER_DOMAIN_SSL+'web/images/cloud_en_banner.png'
|
|
|
},
|
|
|
- 'is_promotion':is_promotion
|
|
|
+ 'promotion':promotion
|
|
|
}
|
|
|
return response.json(0, result)
|
|
|
else:
|