Browse Source

修改语音的返回字段

tanghongbin 4 years ago
parent
commit
8b5d94e8c7
1 changed files with 7 additions and 2 deletions
  1. 7 2
      Controller/VoicePromptController.py

+ 7 - 2
Controller/VoicePromptController.py

@@ -178,8 +178,8 @@ class VoicePromptView(View):
                                                'voice_end_x', 'voice_end_y', 'voice_start_time', 'voice_end_time',
                                                'voice_end_x', 'voice_end_y', 'voice_start_time', 'voice_end_time',
                                                'voice_repeat_day', 'voice_direction')
                                                'voice_repeat_day', 'voice_direction')
                 print(channel_qs)
                 print(channel_qs)
-                res['enter_voice'] = channel_qs[0]['voice_prompt_enter']
-                res['leave_voice'] = channel_qs[0]['voice_prompt_leave']
+                res['enter_voice'] = int(channel_qs[0]['voice_prompt_enter'])
+                res['leave_voice'] = int(channel_qs[0]['voice_prompt_leave'])
                 res['voice_status'] = channel_qs[0]['voice_prompt_status']
                 res['voice_status'] = channel_qs[0]['voice_prompt_status']
                 res['voice_mute'] = channel_qs[0]['voice_prompt_intelligent_mute']
                 res['voice_mute'] = channel_qs[0]['voice_prompt_intelligent_mute']
                 res['start_x'] = channel_qs[0]['voice_start_x']
                 res['start_x'] = channel_qs[0]['voice_start_x']
@@ -236,6 +236,11 @@ class VoicePromptView(View):
                         if res['leave_voice'] == voice['id']:
                         if res['leave_voice'] == voice['id']:
                             res['leave_voice'] = voice
                             res['leave_voice'] = voice
 
 
+            if res['leave_voice'] == 0:
+                res['leave_voice'] = ''
+            if res['enter_voice'] == 0:
+                res['enter_voice'] = ''
+
             res['system']['enter'] = enter_systems
             res['system']['enter'] = enter_systems
             res['system']['leave'] = leave_systems
             res['system']['leave'] = leave_systems
             res['custom']['enter'] = enter_customs
             res['custom']['enter'] = enter_customs