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

ai

parent c231d1e0
......@@ -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:
......
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