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

Merge branch 'query_type' into 'master'

加日志查看耗时

See merge request !93
parents 9741f3b4 77275875
......@@ -286,7 +286,7 @@ def get_type_info_map():
name='suggest',
type='doctor_tips', # doctor
model=doctor.Doctor,
query_deferred=lambda: doctor.Doctor.objects.all().filter(
query_deferred=lambda: doctor.Doctor.objects.filter(
doctor_type__in=[DOCTOR_TYPE.DOCTOR, DOCTOR_TYPE.OFFICER]).query,
get_data_func=DoctorTransfer.get_doctor_suggest_data_list,
bulk_insert_chunk_size=100,
......@@ -392,7 +392,7 @@ def get_type_info_map():
name='suggest-v1',
type='doctor_tips-v1', # doctor
model=doctor.Doctor,
query_deferred=lambda: doctor.Doctor.objects.all().filter(
query_deferred=lambda: doctor.Doctor.objects.filter(
doctor_type__in=[DOCTOR_TYPE.DOCTOR, DOCTOR_TYPE.OFFICER]).query,
get_data_func=DoctorTransferV1.get_doctor_suggest_data_list,
bulk_insert_chunk_size=100,
......
......@@ -11,6 +11,7 @@ import json
from django.conf import settings
from trans2es.commons.commons import get_tips_suggest_list, get_tips_suggest_list_v1
from trans2es.commons.words_utils import QueryWordAttr, get_tips_word_type
from gm_types.gaia import SERVICE_ITEM_PRICE_TYPE, DOCTOR_TYPE
class DoctorTransfer(object):
......@@ -95,6 +96,8 @@ class DoctorTransfer(object):
item_dict["id"] = "doctor_" + str(instance.id)
item_dict["ori_name"] = instance.name
item_dict["is_online"] = instance.is_online
if instance.doctor_type == DOCTOR_TYPE.OFFICER:
item_dict["is_online"] =False
item_dict["order_weight"] = QueryWordAttr.get_doctor_query_word_weight(name=instance.name,
doctor_id=instance.id)
item_dict["results_num"] = QueryWordAttr.get_query_results_num(instance.name)
......@@ -193,6 +196,8 @@ class DoctorTransferV1(object):
item_dict["id"] = "doctor_" + str(instance.id)
item_dict["ori_name"] = instance.name
item_dict["is_online"] = instance.is_online
if instance.doctor_type == DOCTOR_TYPE.OFFICER:
item_dict["is_online"] =False
item_dict["order_weight"] = QueryWordAttr.get_doctor_query_word_weight(name=instance.name,
doctor_id=instance.id)
item_dict["results_num"] = QueryWordAttr.get_query_results_num(instance.name)
......
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