@@ -110,6 +110,13 @@ def decrypt(request): |
||
110 | 110 |
|
111 | 111 |
act = ActivityInfo.objects.filter(brand_id=brand.brand_id, status=True).order_by('-pk').first() |
112 | 112 |
has_unexpired_activity = True if act and act.has_unexpired_activity(model.model_uni_name) else False |
113 |
+ coupon_info = { |
|
114 |
+ 'coupon_expire_at': act.coupon_expire_at, |
|
115 |
+ 'coupon_value': act.coupon_value, |
|
116 |
+ } if has_unexpired_activity else { |
|
117 |
+ 'coupon_expire_at': '', |
|
118 |
+ 'coupon_value': 0, |
|
119 |
+ } |
|
113 | 120 |
|
114 | 121 |
# 红包 |
115 | 122 |
try: |
@@ -130,5 +137,6 @@ def decrypt(request): |
||
130 | 137 |
'SerialNo': sn, |
131 | 138 |
}, |
132 | 139 |
'has_unexpired_activity': has_unexpired_activity, |
140 |
+ 'coupon_info': coupon_info, |
|
133 | 141 |
'redpack_info': elog.redpack_info if elog else {}, |
134 | 142 |
}) |
@@ -291,6 +291,8 @@ def consumer_info_api(request): |
||
291 | 291 |
verifyResult=verifyResult, |
292 | 292 |
dupload=dupload, |
293 | 293 |
submit_during_activity=during_activity, |
294 |
+ coupon_expire_at=coupon_expire_at if during_activity else None, |
|
295 |
+ coupon_value=coupon_value if during_activity else 0, |
|
294 | 296 |
test_user=user.test_user, |
295 | 297 |
) |
296 | 298 |
|
@@ -186,7 +186,7 @@ class ConsumeInfoSubmitLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin): |
||
186 | 186 |
|
187 | 187 |
|
188 | 188 |
class ActivityInfoAdmin(admin.ModelAdmin): |
189 |
- list_display = ('activity_name', 'model_uni_names', 'start_at', 'end_at', 'status', 'created_at', 'updated_at') |
|
189 |
+ list_display = ('activity_name', 'model_uni_names', 'start_at', 'end_at', 'coupon_expire_at', 'coupon_value', 'status', 'created_at', 'updated_at') |
|
190 | 190 |
|
191 | 191 |
|
192 | 192 |
admin.site.register(AdministratorInfo, AdministratorInfoAdmin) |
@@ -499,6 +499,8 @@ class ConsumeInfoSubmitLogInfo(BaseModelMixin): |
||
499 | 499 |
dupload = models.BooleanField(_(u'dupload'), default=False, help_text=_(u'是否为重复提交'), db_index=True) |
500 | 500 |
|
501 | 501 |
submit_during_activity = models.BooleanField(_(u'submit_during_activity'), default=False, help_text=_(u'是否为活动期间上传'), db_index=True) |
502 |
+ coupon_expire_at = models.DateTimeField(_(u'coupon_expire_at'), blank=True, null=True, help_text=_(u'维修券过期时间')) |
|
503 |
+ coupon_value = models.IntegerField(_(u'coupon_value'), default=0, help_text=_(u'维修券金额(单位:分)')) |
|
502 | 504 |
|
503 | 505 |
test_user = models.BooleanField(_(u'test_user'), default=False, help_text=_(u'是否为测试用户'), db_index=True) |
504 | 506 |
|
@@ -530,6 +532,10 @@ class ConsumeInfoSubmitLogInfo(BaseModelMixin): |
||
530 | 532 |
'serialNo': self.serialNo, |
531 | 533 |
'verifyResult': self.verifyResult, |
532 | 534 |
'submit_during_activity': self.submit_during_activity, |
535 |
+ 'coupon_info': { |
|
536 |
+ 'coupon_expire_at': self.coupon_expire_at, |
|
537 |
+ 'coupon_value': self.coupon_value, |
|
538 |
+ }, |
|
533 | 539 |
} |
534 | 540 |
|
535 | 541 |
|
@@ -543,6 +549,9 @@ class ActivityInfo(BaseModelMixin): |
||
543 | 549 |
start_at = models.DateTimeField(_(u'start_at'), help_text=_(u'start_at')) |
544 | 550 |
end_at = models.DateTimeField(_(u'end_at'), help_text=_(u'end_at')) |
545 | 551 |
|
552 |
+ coupon_expire_at = models.DateTimeField(_(u'coupon_expire_at'), blank=True, null=True, help_text=_(u'维修券过期时间')) |
|
553 |
+ coupon_value = models.IntegerField(_(u'coupon_value'), default=0, help_text=_(u'维修券金额(单位:分)')) |
|
554 |
+ |
|
546 | 555 |
class Meta: |
547 | 556 |
verbose_name = _(u'活动信息') |
548 | 557 |
verbose_name_plural = _(u'活动信息') |