lh 2 days ago
parent
commit
4138e040f3
1 changed files with 6 additions and 2 deletions
  1. 6 2
      app/Services/DeepSeek/DeepSeekService.php

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

@@ -208,9 +208,11 @@ class DeepSeekService
 
     public function insertAudioEffect($data) {
         $audio_id = getProp($data, 'audio_id');
+        $chapter_audio = DB::table('mp_chapter_audios')->where('id', $audio_id)->first();
+        if (getProp($chapter_audio, 'generate_status') != '制作成功') Utils::throwError('20003:请先完成有声制作');
         $audio_effect_json = getProp($data, 'audio_effect_json');
         if (!is_string($audio_effect_json)) $audio_effect_json = json_encode($audio_effect_json, 256);
-        return DB::table('mp_chapter_paragraph_audios')->where('id', $audio_id)->update([
+        return DB::table('mp_chapter_audios')->where('id', $audio_id)->update([
             'audio_effect_status'   => '添加中',
             'audio_effect_json'     => $audio_effect_json,
             'updated_at'            => date('Y-m-d H:i:s')
@@ -219,9 +221,11 @@ class DeepSeekService
 
     public function insertBgm($data) {
         $audio_id = getProp($data, 'audio_id');
+        $chapter_audio = DB::table('mp_chapter_audios')->where('id', $audio_id)->first();
+        if (getProp($chapter_audio, 'generate_status') != '制作成功') Utils::throwError('20003:请先完成有声制作');
         $bgm_json = getProp($data, 'bgm_json');
         if (!is_string($bgm_json)) $bgm_json = json_encode($bgm_json, 256);
-        return DB::table('mp_chapter_paragraph_audios')->where('id', $audio_id)->update([
+        return DB::table('mp_chapter_audios')->where('id', $audio_id)->update([
             'bgm_status'    => '添加中',
             'bgm_json'      => $bgm_json,
             'updated_at'    => date('Y-m-d H:i:s')