@@ -986,7 +986,7 @@ def member_activity_contribute_list(request, administrator): |
||
986 | 986 |
contributions = contributions.order_by('-pk') |
987 | 987 |
count = contributions.count() |
988 | 988 |
contributions, left = pagination(contributions, page, num) |
989 |
- contributions = [contribution.data for contribution in contributions] |
|
989 |
+ contributions = [contribution.admindata for contribution in contributions] |
|
990 | 990 |
|
991 | 991 |
return response(data={ |
992 | 992 |
'contributions': contributions, |
@@ -742,6 +742,31 @@ class MemberActivityContributionInfo(BaseModelMixin, BrandInfoMixin): |
||
742 | 742 |
'created_at': tc.local_string(utc_dt=self.created_at), |
743 | 743 |
} |
744 | 744 |
|
745 |
+ @property |
|
746 |
+ def admindata(self): |
|
747 |
+ unlock_welfares = MemberActivityContributionWelfareUnlockingInfo.objects.filter(activity_id=self.activity_id, user_id=self.user_id) |
|
748 |
+ unlock_welfares = [unlock_welfare.data for unlock_welfare in unlock_welfares] |
|
749 |
+ return { |
|
750 |
+ 'contribution_id': self.contribution_id, |
|
751 |
+ 'brand_id': self.brand_id, |
|
752 |
+ 'brand_name': self.brand_name, |
|
753 |
+ 'user_id': self.user_id, |
|
754 |
+ 'activity_id': self.activity_id, |
|
755 |
+ 'content_type': self.content_type, |
|
756 |
+ 'content_type_str': dict(MemberActivityContributionInfo.CONTENT_TYPE).get(self.content_type), |
|
757 |
+ 'title': self.title, |
|
758 |
+ 'content': self.content, |
|
759 |
+ 'user_name': self.user_name, |
|
760 |
+ 'user_avatar': self.user_avatar, |
|
761 |
+ 'images': self.images, |
|
762 |
+ 'video_url': self.video_url or '', |
|
763 |
+ 'audit_status': self.audit_status, |
|
764 |
+ 'audit_status_str': dict(MemberActivityContributionInfo.AUDIT_STATUS).get(self.audit_status), |
|
765 |
+ 'is_selected': self.is_selected, |
|
766 |
+ 'created_at': tc.local_string(utc_dt=self.created_at), |
|
767 |
+ 'unlock_welfares': unlock_welfares, |
|
768 |
+ } |
|
769 |
+ |
|
745 | 770 |
|
746 | 771 |
class MemberActivityContributionWelfareInfo(BaseModelMixin, BrandInfoMixin): |
747 | 772 |
WELFARE_TYPE = ( |