|
|
|
@ -95,6 +95,7 @@ def get_target_show(cinema, show_date): |
|
|
|
target_date_show = '影厅别名,影厅id,影片别名,本地影片id,语言,放映日期,开始时间,结束时间,片长,场间' |
|
|
|
target_date_show = '影厅别名,影厅id,影片别名,本地影片id,语言,放映日期,开始时间,结束时间,片长,场间' |
|
|
|
return target_date_show |
|
|
|
return target_date_show |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 从BI接口获取影片热度信息 |
|
|
|
# 从BI接口获取影片热度信息 |
|
|
|
def get_movie_hot_info_from_bi(cinema, show_date): |
|
|
|
def get_movie_hot_info_from_bi(cinema, show_date): |
|
|
|
data = GetData(cinema) |
|
|
|
data = GetData(cinema) |
|
|
|
@ -108,6 +109,7 @@ def get_movie_hot_info_from_bi(cinema, show_date): |
|
|
|
print('name, title, hot', name, title, hot) |
|
|
|
print('name, title, hot', name, title, hot) |
|
|
|
return True |
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 从本地数据库中获取影片热度信息 |
|
|
|
# 从本地数据库中获取影片热度信息 |
|
|
|
def get_all_movie_hot_info(req_date: str = 'today', show_type: str = 'old', get_num: int = 10): |
|
|
|
def get_all_movie_hot_info(req_date: str = 'today', show_type: str = 'old', get_num: int = 10): |
|
|
|
if req_date == 'today': |
|
|
|
if req_date == 'today': |
|
|
|
@ -115,7 +117,8 @@ def get_all_movie_hot_info(req_date: str = 'today', show_type:str='old', get_num |
|
|
|
else: |
|
|
|
else: |
|
|
|
date_sr = req_date |
|
|
|
date_sr = req_date |
|
|
|
hot_order_day = get_runtime_val('hot_order_day') |
|
|
|
hot_order_day = get_runtime_val('hot_order_day') |
|
|
|
hot_data = MovieHotInfo.objects.filter(Q(req_date=date_sr) & Q(show_type=show_type)).order_by(hot_order_day).all()[:get_num] |
|
|
|
hot_data = MovieHotInfo.objects.filter(Q(req_date=date_sr) & Q(show_type=show_type)).order_by(hot_order_day).all()[ |
|
|
|
|
|
|
|
:get_num] |
|
|
|
if hot_data: |
|
|
|
if hot_data: |
|
|
|
print('if hot_data') |
|
|
|
print('if hot_data') |
|
|
|
title = f"\t{hot_data[0].title}" |
|
|
|
title = f"\t{hot_data[0].title}" |
|
|
|
@ -128,3 +131,17 @@ def get_all_movie_hot_info(req_date: str = 'today', show_type:str='old', get_num |
|
|
|
f"\t《{hot.movie_name}》,{hot.wants},{hot.hots},{','.join([d['value'] for d in json.loads(hot.day_data)])}") |
|
|
|
f"\t《{hot.movie_name}》,{hot.wants},{hot.hots},{','.join([d['value'] for d in json.loads(hot.day_data)])}") |
|
|
|
print(data_list) |
|
|
|
print(data_list) |
|
|
|
return data_list |
|
|
|
return data_list |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 模拟用户设置的新片推荐数量 |
|
|
|
|
|
|
|
def get_new_suggestion(cinema, show_date): |
|
|
|
|
|
|
|
data = GetData(cinema) |
|
|
|
|
|
|
|
movie = data.get_movie_info(show_date, 'new') |
|
|
|
|
|
|
|
new_movie_list = [] |
|
|
|
|
|
|
|
for m in movie: |
|
|
|
|
|
|
|
new_movie = NewMovieSuggestion.objects.filter(movie_name=m['cinema_movie_cn_name']).first() |
|
|
|
|
|
|
|
if new_movie is not None: |
|
|
|
|
|
|
|
new_movie_list.append(f"\t《{m['cinema_movie_cn_name']}》的不同制式版本总计建议至少排{new_movie.suggestion}场;") |
|
|
|
|
|
|
|
if len(new_movie_list) > 0: |
|
|
|
|
|
|
|
return '\n'.join(new_movie_list) |
|
|
|
|
|
|
|
return None |
|
|
|
|