lh 2 месяцев назад
Родитель
Сommit
19cd2da2dd
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      app/Services/DeepSeek/DeepSeekService.php

+ 7 - 3
app/Services/DeepSeek/DeepSeekService.php

@@ -1329,7 +1329,7 @@ class DeepSeekService
         $script = (array)$script;
 
         // 获取分集组信息
-        $groups = DB::table('mp_script_episode_group')->where('script_id', $script_id)
+        $groups = DB::table('mp_script_episode_group')->where('script_id', $script_id)->where('is_deleted', 0)
         ->selectRaw('id as group_id, script_id, group_name, start_episode_number, end_episode_number, intro, highlights, roles, role_relationship, core_contradiction, art_style, scenes, status, episode_content')
         ->orderBy('start_episode_number')->orderBy('id')->get()->map(function ($value) {
             $value = (array)$value;
@@ -1459,7 +1459,7 @@ class DeepSeekService
         // $bid = getProp($data, 'bid', 0);
         $bid = 0;
 
-        $group = DB::table('mp_script_episode_group')->where('id', $group_id)->where('script_id', $script_id)->first();
+        $group = DB::table('mp_script_episode_group')->where('id', $group_id)->where('script_id', $script_id)->where('is_deleted', 0)->first();
         if (!$group) {
             Utils::throwError('20003:剧本分集不存在');
         }
@@ -1478,6 +1478,7 @@ class DeepSeekService
         $exists_groups = DB::table('mp_script_episode_group')
             ->where('script_id', $script_id)
             ->where('id', '<>', $group_id) // 排除当前组
+            ->where('is_deleted', 0)
             ->where(function($query) use ($start_episode_sequence, $end_episode_sequence) {
                 // 检查新范围是否与现有范围重叠
                 $query->where(function($q) use ($start_episode_sequence, $end_episode_sequence) {
@@ -1618,6 +1619,7 @@ class DeepSeekService
                 'reasoning' => $fullReasoningContent,
                 'usage' => $usage
             ];
+            return ;
         }
 
         try {
@@ -1700,6 +1702,7 @@ class DeepSeekService
         // 检查是否存在重叠的剧集序号范围
         $exists_groups = DB::table('mp_script_episode_group')
             ->where('script_id', $script_id)
+            ->where('is_deleted', 0)
             ->where(function($query) use ($start_episode_sequence, $end_episode_sequence) {
                 // 检查新范围是否与现有范围重叠
                 $query->where(function($q) use ($start_episode_sequence, $end_episode_sequence) {
@@ -1746,7 +1749,7 @@ class DeepSeekService
             Utils::throwError('20003:剧本不存在');
         }
 
-        $group = DB::table('mp_script_episode_group')->where('id', $group_id)->where('script_id', $script_id)->first();
+        $group = DB::table('mp_script_episode_group')->where('id', $group_id)->where('script_id', $script_id)->where('is_deleted', 0)->first();
         if (!$group) {
             Utils::throwError('20003:剧本分集不存在');
         }
@@ -1887,6 +1890,7 @@ class DeepSeekService
                 'reasoning' => $fullReasoningContent,
                 'usage' => $usage
             ];
+            return;
         }
 
         try {