Commit 05ea43c5 authored by gaoming's avatar gaoming

渠道区分

parent fd17c141
from .server_settings import *
#from .local_settings import *
\ No newline at end of file
from .local_settings import *
\ No newline at end of file
......@@ -116,8 +116,6 @@ class PromotionChannel(models.Model):
#如果callback_type不存在的话,默认为GET
params.update({'callback_type': CHANNEL_CALLBACK_TYPE.GET_CALLBACK.value[0]})
print(params)
#保存并记录
try:
promotion= PromotionChannel.objects.create(**params)
......
......@@ -88,6 +88,18 @@ class Statistic(View):
#如果不存在,谷歌推广
if not record:
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)
return
......
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