Commit 32be36f2 authored by gaoming's avatar gaoming

last change

parent 7cd31b7a
...@@ -66,10 +66,10 @@ class Statistic(View): ...@@ -66,10 +66,10 @@ class Statistic(View):
client_type=kwargs.get("client_type",CLIENT_TYPE.USER.value[0]) client_type=kwargs.get("client_type",CLIENT_TYPE.USER.value[0])
md5=hashlib.md5() if device_id:
md5=hashlib.md5()
md5.update(device_id.encode(encoding='utf-8')) md5.update(device_id.encode(encoding='utf-8'))
device_id=md5.hexdigest() kwargs.update({"device_id":md5.hexdigest()})
#获取查询子串 #获取查询子串
sub_query=["{0}='{1}'".format(key,value) for key,value in kwargs.items() if key in ["device_id","idfa","idfv","imei","mac"]] sub_query=["{0}='{1}'".format(key,value) for key,value in kwargs.items() if key in ["device_id","idfa","idfv","imei","mac"]]
...@@ -92,6 +92,11 @@ class Statistic(View): ...@@ -92,6 +92,11 @@ class Statistic(View):
if record and record.active_time: if record and record.active_time:
return return
#激活
record.active_time=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
record.save()
#无回调,不做处理 #无回调,不做处理
if record.callback_type==CHANNEL_CALLBACK_TYPE.NO_CALLBACK: if record.callback_type==CHANNEL_CALLBACK_TYPE.NO_CALLBACK:
return return
...@@ -116,9 +121,6 @@ class Statistic(View): ...@@ -116,9 +121,6 @@ class Statistic(View):
except Exception as e: except Exception as e:
channel_logger.error(str(e)) channel_logger.error(str(e))
#保存更新时间
record.save(active_time=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
return JsonResponse({'error':0, 'msg':''}) return JsonResponse({'error':0, 'msg':''})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment