Commit 5b84f971 authored by gaoming's avatar gaoming

Merge branch 'hellogoogle'

modify
parents fd17c141 b738c4aa
...@@ -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)
......
...@@ -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
......
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