Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
search_tips
Commits
77275875
Commit
77275875
authored
Aug 24, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加日志查看耗时
parent
378f5712
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
type_info.py
trans2es/type_info.py
+2
-2
doctor_transfer.py
trans2es/utils/doctor_transfer.py
+5
-0
No files found.
trans2es/type_info.py
View file @
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
,
...
...
trans2es/utils/doctor_transfer.py
View file @
77275875
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment