Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mentha
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
1
Merge Requests
1
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
mentha
Commits
ccf84bb3
Commit
ccf84bb3
authored
4 years ago
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai
parent
c231d1e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
models.py
live/models.py
+20
-0
No files found.
live/models.py
View file @
ccf84bb3
...
...
@@ -617,6 +617,26 @@ class LiveStream(models.Model):
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
None
def
allow_city
(
self
,
hospital_id_city
,
stream_id
):
try
:
all_city_id
=
[]
##获取医生对应的城市ID
if
hospital_id_city
:
all_city_id
.
append
(
hospital_id_city
)
##获取关联美购对应的城市ID
service_id
=
list
(
LiveStreamService
.
objects
.
filter
(
stream_id
=
stream_id
,
is_deleted
=
False
)
.
values_list
(
"service_id"
,
flat
=
True
))
service_info
=
GoodsService
.
get_diary_show_info_by_service_ids
(
service_ids
=
service_id
)
for
key
,
values
in
service_info
.
items
():
city_tag_id
=
values
.
get
(
"city_tag_id"
,
None
)
if
city_tag_id
:
all_city_id
.
append
(
city_tag_id
)
return
list
(
set
(
all_city_id
))
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
[]
class
LiveStreamTag
(
models
.
Model
):
class
Meta
:
...
...
This diff is collapsed.
Click to expand it.
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