|
|
@@ -76,23 +76,25 @@ class Command(CompatibilityBaseCommand):
|
76
|
76
|
'language': userinfo.get('language', ''),
|
77
|
77
|
'remark': userinfo.get('remark', ''),
|
78
|
78
|
})
|
|
79
|
+ UserInfo.objects.filter(unionid=unionid).update(openid=openid, subscribe=subscribe)
|
79
|
80
|
else:
|
80
|
81
|
SubscribeUserInfo.objects.filter(extraid=brand_id, openid=openid).update(subscribe=subscribe)
|
81
|
|
-
|
82
|
|
- UserInfo.objects.filter(unionid=unionid).update(openid=openid, subscribe=subscribe)
|
83
|
|
-
|
84
|
|
- try:
|
85
|
|
- user = UserInfo.objects.get(unionid=unionid)
|
86
|
|
- except UserInfo.DoesNotExist:
|
87
|
|
- continue
|
88
|
|
-
|
89
|
|
- if user.sendcustomwxamessage:
|
90
|
|
- sendcustomwxamessage(
|
91
|
|
- openid='oK7eEjjqhoE6bTLX3k5Xa2reWzuI',
|
92
|
|
- miniappid='wx02c3038b13008270',
|
93
|
|
- pagepath='/pages/index/index',
|
94
|
|
- thumb_media_id=u'xizg0MLt4x4jSJ38mTpf4dzINBqOMwVbfe3DoNFZ1BoqJ9iVyhGk_dvqwVIHcvlo',
|
95
|
|
- title=u'测试一下'
|
96
|
|
- )
|
|
82
|
+ UserInfo.objects.filter(openid=openid).update(subscribe=subscribe)
|
|
83
|
+
|
|
84
|
+ # 通过客服消息发送小程序卡片
|
|
85
|
+ if subscribe:
|
|
86
|
+ try:
|
|
87
|
+ user = UserInfo.objects.get(unionid=unionid)
|
|
88
|
+ except UserInfo.DoesNotExist:
|
|
89
|
+ continue
|
|
90
|
+
|
|
91
|
+ if user.sendcustomwxamessage:
|
|
92
|
+ sendcustomwxamessage(
|
|
93
|
+ openid='oK7eEjjqhoE6bTLX3k5Xa2reWzuI',
|
|
94
|
+ miniappid='wx02c3038b13008270',
|
|
95
|
+ pagepath='/pages/index/index',
|
|
96
|
+ thumb_media_id=u'xizg0MLt4x4jSJ38mTpf4dzINBqOMwVbfe3DoNFZ1BoqJ9iVyhGk_dvqwVIHcvlo',
|
|
97
|
+ title=u'测试一下'
|
|
98
|
+ )
|
97
|
99
|
|
98
|
100
|
close_old_connections()
|