ad5L316">316
- brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
-
+class ShotTypeInfo(BaseModelMixin, BrandInfoMixin):
shot_type_id = ShortUUIDField(_(u'shot_type_id'), max_length=32, blank=True, null=True, help_text=u'镜头类型唯一标识', db_index=True, unique=True)
shot_type_name = models.CharField(_(u'shot_type_name'), max_length=255, blank=True, null=True, help_text=u'镜头类型名称')
@@ -341,7 +330,7 @@ class ShotTypeInfo(BaseModelMixin):
}
-class MemberActivityInfo(BaseModelMixin):
+class MemberActivityInfo(BaseModelMixin, BrandInfoMixin):
ACTIVITY_TYPE = (
(0, u'线下活动'),
(1, u'公众号文章'),
@@ -355,9 +344,6 @@ class MemberActivityInfo(BaseModelMixin):
(2, u'下线'),
)
- brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, default='', help_text=u'品牌唯一标识', db_index=True)
- brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, default='', help_text=u'品牌名称')
-
activity_id = ShortUUIDField(_(u'activity_id'), max_length=32, blank=True, help_text=u'活动唯一标识', db_index=True, unique=True)
activity_type = models.IntegerField(_(u'activity_type'), choices=ACTIVITY_TYPE, default=0, help_text=u'活动类型', db_index=True)
@@ -572,10 +558,7 @@ class MemberActivityInfo(BaseModelMixin):
}
-class MemberActivitySignupInfo(BaseModelMixin):
- brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
- brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
-
+class MemberActivitySignupInfo(BaseModelMixin, BrandInfoMixin):
signup_id = ShortUUIDField(_(u'signup_id'), max_length=32, blank=True, null=True, help_text=u'活动报名唯一标识', db_index=True, unique=True)
user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True)
@@ -610,10 +593,7 @@ class MemberActivitySignupInfo(BaseModelMixin):
}
-class MemberActivitySigninInfo(BaseModelMixin):
- brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
- brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
-
+class MemberActivitySigninInfo(BaseModelMixin, BrandInfoMixin):
signin_id = ShortUUIDField(_(u'signin_id'), max_length=32, blank=True, null=True, help_text=u'活动签到唯一标识', db_index=True, unique=True)
user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True)
@@ -634,10 +614,7 @@ class MemberActivitySigninInfo(BaseModelMixin):
return '%d' % self.pk
-class MemberActivityGroupShareInfo(BaseModelMixin):
- brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
- brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
-
+class MemberActivityGroupShareInfo(BaseModelMixin, BrandInfoMixin):
group_share_id = ShortUUIDField(_(u'group_share_id'), max_length=32, blank=True, null=True, help_text=u'活动群组分享唯一标识', db_index=True)
activity_id = models.CharField(_(u'activity_id'), max_length=32, blank=True, null=True, help_text=u'活动唯一标识', db_index=True)
@@ -664,7 +641,7 @@ class MemberActivityGroupShareInfo(BaseModelMixin):
return '%d' % self.pk
-class MemberActivityContributionInfo(BaseModelMixin):
+class MemberActivityContributionInfo(BaseModelMixin, BrandInfoMixin):
CONTENT_TYPE = (
(0, u'投稿'),
(1, u'创作日记'),
@@ -678,9 +655,6 @@ class MemberActivityContributionInfo(BaseModelMixin):
(2, u'未通过'),
)
- brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
- brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
-
contribution_id = ShortUUIDField(_(u'contribution_id'), max_length=32, blank=True, null=True, help_text=u'投稿唯一标识', db_index=True, unique=True)
user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True)
@@ -715,6 +689,8 @@ class MemberActivityContributionInfo(BaseModelMixin):
def data(self):
return {
'contribution_id': self.contribution_id,
+ 'brand_id': self.brand_id,
+ 'brand_name': self.brand_name,
'user_id': self.user_id,
'activity_id': self.activity_id,
'content_type': self.content_type,
@@ -730,22 +706,18 @@ class MemberActivityContributionInfo(BaseModelMixin):
}
-class MemberActivityContributionWelfareInfo(BaseModelMixin):
+class MemberActivityContributionWelfareInfo(BaseModelMixin, BrandInfoMixin):
WELFARE_TYPE = (
(0, u'实物'),
(1, u'积分'),
(2, u'虚拟'),
)
- brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
- brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
+ welfare_id = ShortUUIDField(_(u'welfare_id'), max_length=32, blank=True, null=True, help_text=u'福利唯一标识', db_index=True, unique=True)
activity_id = models.CharField(_(u'activity_id'), max_length=32, blank=True, null=True, help_text=u'活动唯一标识', db_index=True)
- welfare_id = ShortUUIDField(_(u'welfare_id'), max_length=32, blank=True, null=True, help_text=u'福利唯一标识', db_index=True, unique=True)
-
welfare_type = models.IntegerField(_(u'welfare_type'), choices=WELFARE_TYPE, default=0, help_text=u'福利类型', db_index=True)
-
welfare_title = models.CharField(_(u'welfare_title'), max_length=255, blank=True, null=True, help_text=u'福利标题')
welfare_detail = RichTextField(_(u'welfare_detail'), blank=True, null=True, help_text=u'福利详情')
welfare_value = models.IntegerField(_(u'welfare_value'), default=0, help_text=_(u'福利数量'))
@@ -771,8 +743,10 @@ class MemberActivityContributionWelfareInfo(BaseModelMixin):
@property
def data(self):
return {
- 'activity_id': self.activity_id,
'welfare_id': self.welfare_id,
+ 'brand_id': self.brand_id,
+ 'brand_name': self.brand_name,
+ 'activity_id': self.activity_id,
'welfare_type': self.welfare_type,
'welfare_type_str': dict(MemberActivityContributionWelfareInfo.WELFARE_TYPE).get(self.welfare_type),
'welfare_title': self.welfare_title,
@@ -781,3 +755,55 @@ class MemberActivityContributionWelfareInfo(BaseModelMixin):
'welfare_image_url': self.welfare_image_url,
'welfare_image_path': self.welfare_image_path,
}
+
+
+class MemberActivityContributionWelfareUnlockingInfo(BaseModelMixin, BrandInfoMixin):
+ WELFARE_TYPE = (
+ (0, u'实物'),
+ (1, u'积分'),
+ (2, u'虚拟'),
+ )
+
+ unlocking_id = ShortUUIDField(_(u'unlocking_id'), max_length=32, blank=True, null=True, help_text=u'福利解锁唯一标识', db_index=True, unique=True)
+
+ admin_id = models.CharField(_(u'admin_id'), max_length=32, blank=True, null=True, help_text=u'管理员唯一标识', db_index=True)
+ user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True)
+
+ activity_id = models.CharField(_(u'activity_id'), max_length=32, blank=True, null=True, help_text=u'活动唯一标识', db_index=True)
+
+ contribution_id = models.CharField(_(u'contribution_id'), max_length=32, blank=True, null=True, help_text=u'投稿唯一标识', db_index=True)
+
+ welfare_id = models.CharField(_(u'welfare_id'), max_length=32, blank=True, null=True, help_text=u'福利唯一标识', db_index=True)
+
+ name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'姓名')
+ phone = models.CharField(_(u'phone'), max_length=255, blank=True, null=True, help_text=u'电话')
+ address = models.CharField(_(u'address'), max_length=255, blank=True, null=True, help_text=u'地址')
+
+ tracking_number = models.CharField(_(u'tracking_number'), max_length=255, blank=True, null=True, help_text=u'快递单号')
+
+ is_handled = models.BooleanField(_(u'is_handled'), default=False, help_text=_(u'是否已处理'))
+
+ class Meta:
+ verbose_name = _(u'会员活动投稿福利解锁信息')
+ verbose_name_plural = _(u'会员活动投稿福利解锁信息')
+
+ def __unicode__(self):
+ return '%d' % self.pk
+
+ @property
+ def data(self):
+ return {
+ 'unlocking_id': self.unlocking_id,
+ 'brand_id': self.brand_id,
+ 'brand_name': self.brand_name,
+ 'admin_id': self.admin_id,
+ 'user_id': self.user_id,
+ 'activity_id': self.activity_id,
+ 'contribution_id': self.contribution_id,
+ 'welfare_id': self.welfare_id,
+ 'name': self.name,
+ 'phone': self.phone,
+ 'address': self.address,
+ 'tracking_number': self.tracking_number,
+ 'is_handled': self.is_handled,
+ }