,

Kimi.Huang 5 lat temu
rodzic
commit
86abb0c039
1 zmienionych plików z 9 dodań i 5 usunięć
  1. 9 5
      mch/models.py

+ 9 - 5
mch/models.py

@@ -515,6 +515,13 @@ class ConsumeInfoSubmitLogInfo(BaseModelMixin):
515 515
         return info
516 516
 
517 517
     @property
518
+    def coupon_info(self):
519
+        return {
520
+            'coupon_expire_at': '',
521
+            'coupon_value': 0,
522
+        },
523
+
524
+    @property
518 525
     def data(self):
519 526
         if self.submit_during_activity:
520 527
             try:
@@ -534,10 +541,7 @@ class ConsumeInfoSubmitLogInfo(BaseModelMixin):
534 541
             'serialNo': self.serialNo,
535 542
             'verifyResult': self.verifyResult,
536 543
             'submit_during_activity': self.submit_during_activity,
537
-            'coupon_info': act.coupon_info(created_at=self.created_at) if act else {
538
-                'coupon_expire_at': '',
539
-                'coupon_value': 0,
540
-            },
544
+            'coupon_info': act.coupon_info(created_at=self.created_at) if act else self.coupon_info,
541 545
         }
542 546
 
543 547
 
@@ -590,4 +594,4 @@ class ActivityInfo(BaseModelMixin):
590 594
         return {
591 595
             'coupon_expire_at': self.final_coupon_expire_at(created_at=created_at),
592 596
             'coupon_value': self.coupon_value,
593
-        }
597
+        },