@@ -1171,7 +1171,6 @@ def member_activity_contribute_welfare_unlock(request, administrator): |
||
| 1171 | 1171 |
'contribution_id': contribution_id, |
| 1172 | 1172 |
'welfare_type': welfare.welfare_type, |
| 1173 | 1173 |
'welfare_value': welfare.welfare_value, |
| 1174 |
- 'is_handled': False, |
|
| 1175 | 1174 |
} |
| 1176 | 1175 |
) |
| 1177 | 1176 |
|
@@ -1220,6 +1219,7 @@ def member_activity_contribute_welfare_unlocking_list(request, administrator): |
||
| 1220 | 1219 |
activity_id = request.POST.get('activity_id', '')
|
| 1221 | 1220 |
contribution_id = request.POST.get('contribution_id', '')
|
| 1222 | 1221 |
welfare_id = request.POST.get('welfare_id', '')
|
| 1222 |
+ query = request.POST.get('query', '')
|
|
| 1223 | 1223 |
page = request.POST.get('page', 1)
|
| 1224 | 1224 |
num = request.POST.get('num', 20)
|
| 1225 | 1225 |
|
@@ -1232,6 +1232,9 @@ def member_activity_contribute_welfare_unlocking_list(request, administrator): |
||
| 1232 | 1232 |
unlockings = unlockings.filter(contribution_id=contribution_id) |
| 1233 | 1233 |
if welfare_id: |
| 1234 | 1234 |
unlockings = unlockings.filter(welfare_id=welfare_id) |
| 1235 |
+ if query: |
|
| 1236 |
+ unlockings = unlockings.filter(Q(name__icontains=query) | Q(phone__icontains=query)) |
|
| 1237 |
+ |
|
| 1235 | 1238 |
unlockings = unlockings.order_by('-pk')
|
| 1236 | 1239 |
count = unlockings.count() |
| 1237 | 1240 |
unlockings, left = pagination(unlockings, page, num) |
@@ -925,6 +925,12 @@ class MemberActivityContributionWelfareUnlockingInfo(BaseModelMixin, BrandInfoMi |
||
| 925 | 925 |
welfare = MemberActivityContributionWelfareInfo.objects.get(welfare_id=self.welfare_id) |
| 926 | 926 |
except MemberActivityContributionWelfareInfo.DoesNotExist: |
| 927 | 927 |
welfare = None |
| 928 |
+ |
|
| 929 |
+ try: |
|
| 930 |
+ user = MemberActivitySignupInfo.objects.get(user_id=self.user_id, activity_id=self.activity_id) |
|
| 931 |
+ except MemberActivitySignupInfo.DoesNotExist: |
|
| 932 |
+ user = None |
|
| 933 |
+ |
|
| 928 | 934 |
return {
|
| 929 | 935 |
'unlocking_id': self.unlocking_id, |
| 930 | 936 |
'brand_id': self.brand_id, |
@@ -941,4 +947,7 @@ class MemberActivityContributionWelfareUnlockingInfo(BaseModelMixin, BrandInfoMi |
||
| 941 | 947 |
'tracking_number': self.tracking_number, |
| 942 | 948 |
'is_handled': self.is_handled, |
| 943 | 949 |
'created_at': tc.local_string(utc_dt=self.created_at), |
| 950 |
+ |
|
| 951 |
+ 'username': user.name if user else '', |
|
| 952 |
+ 'useravatar': user.avatar if user else '', |
|
| 944 | 953 |
} |