|
@@ -104,10 +104,15 @@ class DetectControllerView(View):
|
|
|
app_type = request_dict.get('app_type', None)
|
|
|
push_type = request_dict.get('push_type', None)
|
|
|
status = request_dict.get('status', None)
|
|
|
+ m_code = request_dict.get('m_code',None)
|
|
|
print('status')
|
|
|
print(status)
|
|
|
+ if not status:
|
|
|
+ return response.json(444,'status')
|
|
|
if status == '0':
|
|
|
- uid_app_qs = UID_App.objects.filter(appBundleId=appBundleId, userID_id=userID, token_val=token_val,
|
|
|
+ if not all([app_type,appBundleId,uid,m_code]):
|
|
|
+ return response.json(444,'app_type,appBundleId,uid,m_code')
|
|
|
+ uid_app_qs = UID_App.objects.filter(appBundleId=appBundleId, userID_id=userID, m_code=m_code,
|
|
|
uid=uid,app_type=app_type)
|
|
|
if uid_app_qs.exists():
|
|
|
uid_app_qs.update(status=0)
|
|
@@ -115,18 +120,15 @@ class DetectControllerView(View):
|
|
|
else:
|
|
|
return response.json(173)
|
|
|
elif status == '1':
|
|
|
- # return response.json(10)
|
|
|
-
|
|
|
+ if not all([appBundleId,app_type,token_val,uid,m_code]):
|
|
|
+ return response.json(444,'appBundleId,app_type,token_val,uid,m_code')
|
|
|
dvqs = Device_Info.objects.filter(userID_id=userID, UID=uid)
|
|
|
- # aiqs = App_Info.objects.filter(appBundleId=appBundleId).values('app_type')
|
|
|
- # print(dvqs)
|
|
|
- # print(aiqs)
|
|
|
- # if dvqs.exists() and aiqs.exists():
|
|
|
+
|
|
|
if dvqs.exists():
|
|
|
now_time = int(time.time())
|
|
|
try:
|
|
|
uid_app_qs = UID_App.objects.filter(appBundleId=appBundleId, userID_id=userID, token_val=token_val,
|
|
|
- uid=uid)
|
|
|
+ uid=uid,m_code=m_code)
|
|
|
print(uid_app_qs)
|
|
|
if uid_app_qs.exists():
|
|
|
uid_app_qs.update(status=1)
|