@@ -325,6 +325,7 @@ def consumer_info_api(request): |
||
| 325 | 325 |
# 记录用户信息提交记录 |
| 326 | 326 |
log = ConsumeInfoSubmitLogInfo.objects.create( |
| 327 | 327 |
user_id=user_id, |
| 328 |
+ phone=user.phone, |
|
| 328 | 329 |
lat=lat, |
| 329 | 330 |
lon=lon, |
| 330 | 331 |
brand_id=brand.brand_id, |
@@ -97,5 +97,6 @@ class Command(CompatibilityBaseCommand): |
||
| 97 | 97 |
logs = ConsumeInfoSubmitLogInfo.objects.filter(user_id=userinfo.user_id) |
| 98 | 98 |
for log in logs: |
| 99 | 99 |
log.province = log.province if log.lat and log.lon else province_name |
| 100 |
+ log.phone = userinfo.phone |
|
| 100 | 101 |
|
| 101 | 102 |
close_old_connections() |
@@ -46,7 +46,7 @@ def DJANGO_WE_COMPONENT_CALLBACK_FUNC(request, appid, data, decrypted=None): |
||
| 46 | 46 |
""" WeChat Component Message Callback Func """ |
| 47 | 47 |
from account.models import UserInfo |
| 48 | 48 |
from utils.redis.connect import r |
| 49 |
- from utils.redis.rkeys import SUBSCRIBE_USERINFO_LIST |
|
| 49 |
+ from utils.redis.rkeys import SUBSCRIBE_USERINFO_LIST, MEMBERCARD_USERINFO_LIST |
|
| 50 | 50 |
|
| 51 | 51 |
logger.info(appid) |
| 52 | 52 |
logger.info(data) |
@@ -61,12 +61,17 @@ def DJANGO_WE_COMPONENT_CALLBACK_FUNC(request, appid, data, decrypted=None): |
||
| 61 | 61 |
|
| 62 | 62 |
# 富士 |
| 63 | 63 |
if tousername == 'gh_0cbd39fdde28': |
| 64 |
+ brand_id = settings.COMPONENT_CALLBACK_CONFIG[tousername] |
|
| 64 | 65 |
if event == 'user_get_card': |
| 65 | 66 |
UserInfo.objects.using('fujifilm').filter(unionid=unionid).update(openid=openid, has_membercard=True, membercardid=membercardid, memberusercardcode=memberusercardcode)
|
| 67 |
+ r.rpushjson(MEMBERCARD_USERINFO_LIST, {
|
|
| 68 |
+ 'brand_id': brand_id, |
|
| 69 |
+ 'card_id': membercardid, |
|
| 70 |
+ 'code': memberusercardcode |
|
| 71 |
+ }) |
|
| 66 | 72 |
elif event == 'user_del_card': |
| 67 | 73 |
UserInfo.objects.using('fujifilm').filter(memberusercardcode=memberusercardcode).update(has_membercard=False)
|
| 68 | 74 |
elif event == 'subscribe' or event == 'unsubscribe': |
| 69 |
- brand_id = settings.COMPONENT_CALLBACK_CONFIG[tousername] |
|
| 70 | 75 |
r.rpushjson(SUBSCRIBE_USERINFO_LIST % brand_id, {
|
| 71 | 76 |
'brand_id': brand_id, |
| 72 | 77 |
'openid': openid, |
@@ -74,12 +79,17 @@ def DJANGO_WE_COMPONENT_CALLBACK_FUNC(request, appid, data, decrypted=None): |
||
| 74 | 79 |
|
| 75 | 80 |
# WINE |
| 76 | 81 |
if tousername == 'gh_2e5f21d2a57d': |
| 82 |
+ brand_id = settings.COMPONENT_CALLBACK_CONFIG[tousername] |
|
| 77 | 83 |
if event == 'user_get_card': |
| 78 | 84 |
UserInfo.objects.using('wine').filter(unionid=unionid).update(openid=openid, has_membercard=True, membercardid=membercardid, memberusercardcode=memberusercardcode)
|
| 85 |
+ r.rpushjson(MEMBERCARD_USERINFO_LIST, {
|
|
| 86 |
+ 'brand_id': brand_id, |
|
| 87 |
+ 'card_id': membercardid, |
|
| 88 |
+ 'code': memberusercardcode |
|
| 89 |
+ }) |
|
| 79 | 90 |
elif event == 'user_del_card': |
| 80 | 91 |
UserInfo.objects.using('wine').filter(memberusercardcode=memberusercardcode).update(has_membercard=False)
|
| 81 | 92 |
elif event == 'subscribe' or event == 'unsubscribe': |
| 82 |
- brand_id = settings.COMPONENT_CALLBACK_CONFIG[tousername] |
|
| 83 | 93 |
r.rpushjson(SUBSCRIBE_USERINFO_LIST % brand_id, {
|
| 84 | 94 |
'brand_id': brand_id, |
| 85 | 95 |
'openid': openid, |
@@ -87,12 +97,17 @@ def DJANGO_WE_COMPONENT_CALLBACK_FUNC(request, appid, data, decrypted=None): |
||
| 87 | 97 |
|
| 88 | 98 |
# 腾龙 |
| 89 | 99 |
if tousername == 'gh_c87efc299ce5': |
| 100 |
+ brand_id = settings.COMPONENT_CALLBACK_CONFIG[tousername] |
|
| 90 | 101 |
if event == 'user_get_card': |
| 91 | 102 |
UserInfo.objects.filter(unionid=unionid).update(openid=openid, has_membercard=True, membercardid=membercardid, memberusercardcode=memberusercardcode) |
| 103 |
+ r.rpushjson(MEMBERCARD_USERINFO_LIST, {
|
|
| 104 |
+ 'brand_id': brand_id, |
|
| 105 |
+ 'card_id': membercardid, |
|
| 106 |
+ 'code': memberusercardcode |
|
| 107 |
+ }) |
|
| 92 | 108 |
elif event == 'user_del_card': |
| 93 | 109 |
UserInfo.objects.filter(memberusercardcode=memberusercardcode).update(has_membercard=False) |
| 94 | 110 |
elif event == 'subscribe' or event == 'unsubscribe': |
| 95 |
- brand_id = settings.COMPONENT_CALLBACK_CONFIG[tousername] |
|
| 96 | 111 |
r.rpushjson(SUBSCRIBE_USERINFO_LIST % brand_id, {
|
| 97 | 112 |
'brand_id': brand_id, |
| 98 | 113 |
'openid': openid, |
@@ -220,9 +220,10 @@ class LatestAppScreenInfoAdmin(admin.ModelAdmin): |
||
| 220 | 220 |
obj.save() |
| 221 | 221 |
|
| 222 | 222 |
|
| 223 |
-class ConsumeInfoSubmitLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin): |
|
| 223 |
+class ConsumeInfoSubmitLogInfoAdmin(AdvancedExportExcelModelAdmin, ReadOnlyModelAdmin, admin.ModelAdmin): |
|
| 224 | 224 |
list_display = ('user_id', 'phone', 'model_name', 'serialNo', 'dupload', 'submit_during_activity', 'has_used', 'created_at')
|
| 225 | 225 |
list_filter = ('brand_id', 'submit_during_activity', 'activity_id', 'dupload', 'test_user', 'verifyResult', 'has_used', 'status', 'code_version', 'created_at')
|
| 226 |
+ excel_fields = ('created_at', 'phone', 'model_uni_name', 'model_name', 'serialNo')
|
|
| 226 | 227 |
search_fields = ('user_id', 'phone', 'serialNo', 'model_name')
|
| 227 | 228 |
|
| 228 | 229 |
|