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
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
gaoming
channels
Commits
5b84f971
Commit
5b84f971
authored
Jun 24, 2019
by
gaoming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hellogoogle'
modify
parents
fd17c141
b738c4aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
models.py
like/models.py
+0
-2
views.py
like/views.py
+12
-0
No files found.
like/models.py
View file @
5b84f971
...
@@ -116,8 +116,6 @@ class PromotionChannel(models.Model):
...
@@ -116,8 +116,6 @@ class PromotionChannel(models.Model):
#如果callback_type不存在的话,默认为GET
#如果callback_type不存在的话,默认为GET
params
.
update
({
'callback_type'
:
CHANNEL_CALLBACK_TYPE
.
GET_CALLBACK
.
value
[
0
]})
params
.
update
({
'callback_type'
:
CHANNEL_CALLBACK_TYPE
.
GET_CALLBACK
.
value
[
0
]})
print
(
params
)
#保存并记录
#保存并记录
try
:
try
:
promotion
=
PromotionChannel
.
objects
.
create
(
**
params
)
promotion
=
PromotionChannel
.
objects
.
create
(
**
params
)
...
...
like/views.py
View file @
5b84f971
...
@@ -88,6 +88,18 @@ class Statistic(View):
...
@@ -88,6 +88,18 @@ class Statistic(View):
#如果不存在,谷歌推广
#如果不存在,谷歌推广
if
not
record
:
if
not
record
:
kwargs
.
update
({
"appid"
:
"google"
,
"active_time"
:
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)})
kwargs
.
update
({
"appid"
:
"google"
,
"active_time"
:
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)})
platform
=
kwargs
.
get
(
"platform"
,
""
)
print
(
"platform is:"
,
platform
)
if
platform
.
strip
()
.
lower
()
==
"iphone"
:
kwargs
.
update
({
"appid"
:
"appstore"
})
if
platform
.
strip
()
.
lower
()
==
"android"
:
kwargs
.
update
({
"appid"
:
"mainpackage"
})
print
(
kwargs
)
record
=
PromotionChannel
.
record
(
None
,
**
kwargs
)
record
=
PromotionChannel
.
record
(
None
,
**
kwargs
)
return
return
...
...
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