Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
channels
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
backend
channels
Commits
32be36f2
Commit
32be36f2
authored
Jun 06, 2019
by
gaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last change
parent
7cd31b7a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
7 deletions
+9
-7
settings.cpython-36.pyc
channels/__pycache__/settings.cpython-36.pyc
+0
-0
models.cpython-36.pyc
like/__pycache__/models.cpython-36.pyc
+0
-0
views.cpython-36.pyc
like/__pycache__/views.cpython-36.pyc
+0
-0
views.py
like/views.py
+9
-7
No files found.
channels/__pycache__/settings.cpython-36.pyc
View file @
32be36f2
No preview for this file type
like/__pycache__/models.cpython-36.pyc
View file @
32be36f2
No preview for this file type
like/__pycache__/views.cpython-36.pyc
View file @
32be36f2
No preview for this file type
like/views.py
View file @
32be36f2
...
@@ -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'
:
''
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment