lh 3 dni temu
rodzic
commit
83b58847c6

+ 3 - 1
app/Http/Controllers/DeepSeek/DeepSeekController.php

@@ -147,7 +147,9 @@ class DeepSeekController extends BaseController
             if ($counter % 10 == 0) {
                 // 每10s判断是否有新url生成,如果有则发送消息
                 $paragraph_urls = DB::table('mp_chapter_paragraph_audios')->where('bid', $bid)->where('version_id', $version_id)
-                ->where('cid', $cid)->where('paragraph_audio_url', '!=', '')->select('sequence', 'paragraph_audio_url')
+                ->where('cid', $cid)->where(function($query) {
+                    return $query->where('paragraph_audio_url', '!=', '')->orWhere('error_msg', '!=', '');
+                })->select('sequence', 'paragraph_audio_url', 'error_msg')
                 ->get()->map(function ($value) {
                     return (array)$value;
                 })->toArray();

+ 6 - 1
app/Services/DeepSeek/DeepSeekService.php

@@ -124,6 +124,7 @@ class DeepSeekService
             'loudness_ratio'=> getProp($data, 'loudness_ratio'),
             'emotion_scale' => getProp($data, 'emotion_scale'),
             'paragraph_audio_url' => '',
+            'error_mgs'     => '',
             'updated_at'    => date('Y-m-d H:i:s')
         ];
         if (getProp($data, 'paragraph_audio_url')) $list['paragraph_audio_url'] = getProp($data, 'paragraph_audio_url');
@@ -131,9 +132,13 @@ class DeepSeekService
             $boolen = DB::table('mp_chapter_paragraph_audios')->where('id', $id)->update($list);
         }else {
             $list['created_at'] = date('Y-m-d H:i:s');
-            $boolen = DB::table('mp_chapter_paragraph_audios')->insert($list);
+            $id = DB::table('mp_chapter_paragraph_audios')->insertGetId($list);
+            $boolen = $id ? true : false;
         }
 
+        // 根据ID通过API通知合成音频
+        
+
         return $boolen;
     }