Commit df566a96 authored by 李小芳's avatar 李小芳

修改script脚本

parent 631117e9
......@@ -976,7 +976,7 @@ class Answer(models.Model):
n_days = today - delta
data = StrategyContentExposureIndex.objects.using(settings.DORIS_DB_NAME).filter(
create_day=n_days, card_id=answer_id, card_content_type="answer").first()
if data.ctr >= 0.05 and data.preciseexposure_num >= 50 and data.avg_page_stay >= 20:
if data and data.ctr >= 0.05 and data.preciseexposure_num >= 50 and data.avg_page_stay >= 20:
return 0 # 0是正常展示 1不展示
else:
return 1
......@@ -995,7 +995,7 @@ class Answer(models.Model):
if create_time:
if delta_30 and d2 - delta_30 <= create_time:
return 30
elif delta_90 and d2 - delta_90 <= create_time:
elif delta_90 and d2 - delta_90 <= create_time:
return 90
elif delta_365 and d2 - delta_365 <= create_time:
return 365
......
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