Commit 7ee68127 authored by 段英荣's avatar 段英荣

Merge branch 'gyz' into 'master'

like stat alter

See merge request alpha/physical!499
parents 221dce25 e9d0fdab
......@@ -4,7 +4,7 @@ import datetime
from libs.cache import redis_client
from libs.error import logging_exception
from django.conf import settings
from trans2es.models.portrait_stat import LikeDeviceTagStat
from trans2es.models.portrait_stat import LikeTopicStat
try:
ps = redis_client.pubsub()
......@@ -28,9 +28,9 @@ try:
insert_list = []
for topic in insert_topic_ids:
insert_list.append(
LikeDeviceTagStat(create_time=datetime.datetime.today(), update_time=datetime.datetime.today(),
LikeTopicStat(create_time=datetime.datetime.today(), update_time=datetime.datetime.today(),
topic_id=topic, is_new_topic=0, topic_ctr_30=0.0, like_rate_30=0.0))
LikeDeviceTagStat.objects.using(settings.MASTER_DB_NAME).bulk_create(insert_list)
LikeTopicStat.objects.using(settings.MASTER_DB_NAME).bulk_create(insert_list)
logging.info("impressions count gt 100 topic ids" + str(insert_topic_ids))
json_all_new_topic_impression_count = json.dumps(all_new_topic_impression_count)
logging.info("all_new_topic_impression_count" + str(all_new_topic_impression_count))
......
......@@ -34,7 +34,7 @@ from trans2es.models.tag import Tag
from libs.cache import redis_client
from trans2es.models.tag import TopicTag
from libs.error import logging_exception
from trans2es.models.portrait_stat import LikeDeviceTagStat
from trans2es.models.portrait_stat import LikeTopicStat
......@@ -241,10 +241,10 @@ class Command(BaseCommand):
insert_list = []
for topic in insert_topic_ids:
insert_list.append(
LikeDeviceTagStat(create_time=datetime.datetime.today(),
LikeTopicStat(create_time=datetime.datetime.today(),
update_time=datetime.datetime.today(),
topic_id=topic, is_new_topic=0, topic_ctr_30=0.0, like_rate_30=0.0))
LikeDeviceTagStat.objects.using(settings.MASTER_DB_NAME).bulk_create(insert_list)
LikeTopicStat.objects.using(settings.MASTER_DB_NAME).bulk_create(insert_list)
logging.info("impressions count gt 100 topic ids" + str(insert_topic_ids))
json_all_new_topic_impression_count = json.dumps(all_new_topic_impression_count)
logging.info("all_new_topic_impression_count" + str(all_new_topic_impression_count))
......
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