增加福利解锁模板消息返回结果

FFIB 1 rok temu
rodzic
commit
7ff56cf0d7

+ 4 - 1
api/admin_views.py

@@ -1042,8 +1042,11 @@ def member_activity_contribute_welfare_unlock(request, administrator):
1042 1042
     wxcfg = WECHAT.get('MINIAPP', {})
1043 1043
     appid = wxcfg.get('appID')
1044 1044
 
1045
-    sendwxasubscribemessage(openid=user.openid_miniapp, template_id=settings.TEMPLATE_ID_UNLOCKING_WELFARE, data=data, miniprogram_state=None, lang=None, page='/pages/member/activity/activity?unlocking_id={}'.format(unlocking_info.unlocking_id))
1045
+    res = sendwxasubscribemessage(openid=user.openid_miniapp, template_id=settings.TEMPLATE_ID_UNLOCKING_WELFARE, data=data, miniprogram_state=None, lang=None, page='/pages/member/activity/activity?unlocking_id={}'.format(unlocking_info.unlocking_id))
1046 1046
     # sendtemplatemessage(openid=user.openid, template_id=settings.TEMPLATE_ID_UNLOCKING_WELFARE, data=data, miniappid=appid, minipagepath='/pages/member/activity/activity?unlocking_id={}'.format(unlocking_info.unlocking_id))
1047
+    
1048
+    unlocking_info.send_template_message_res = json.dumps(res)
1049
+    unlocking_info.save()
1047 1050
 
1048 1051
     return response(200, 'Unlock Member Activity Contribute Welfare Success', u'解锁会员活动投稿福利成功')
1049 1052
 

+ 21 - 0
member/migrations/0072_memberactivitycontributionwelfareunlockinginfo_send_template_message_res.py

@@ -0,0 +1,21 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+# Generated by Django 3.2.16 on 2024-05-08 01:58
4
+
5
+from django.db import migrations
6
+import jsonfield.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('member', '0071_auto_20240410_1612'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.AddField(
17
+            model_name='memberactivitycontributionwelfareunlockinginfo',
18
+            name='send_template_message_res',
19
+            field=jsonfield.fields.JSONField(blank=True, help_text='send_template_message_res', null=True, verbose_name='send_template_message_res'),
20
+        ),
21
+    ]

+ 3 - 0
member/models.py

@@ -1099,6 +1099,9 @@ class MemberActivityContributionWelfareUnlockingInfo(BaseModelMixin, BrandInfoMi
1099 1099
 
1100 1100
     is_handled = models.BooleanField(_(u'is_handled'), default=False, help_text=u'是否已处理')
1101 1101
 
1102
+    send_template_message_res = JSONField(_(u'send_template_message_res'), blank=True, null=True, help_text=u'send_template_message_res')
1103
+
1104
+
1102 1105
     class Meta:
1103 1106
         verbose_name = _(u'会员活动投稿福利解锁信息')
1104 1107
         verbose_name_plural = _(u'会员活动投稿福利解锁信息')