|
@@ -808,6 +808,25 @@ class DeepSeekService
|
|
|
return $query->orderBy('created_at', 'desc')->paginate(12);
|
|
return $query->orderBy('created_at', 'desc')->paginate(12);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function scriptInfo($data) {
|
|
|
|
|
+ $script_id = getProp($data, 'script_id');
|
|
|
|
|
+ $script = DB::table('mp_scripts')->where('id', $script_id)->where('is_deleted', 0)
|
|
|
|
|
+ ->selectRaw('id as script_id, script_name, intro, highlights, roles, role_relationship, core_contradiction, art_style, scenes, status, start_episode_sequence, end_episode_sequence, episode_num, remark, created_at')->first();
|
|
|
|
|
+ if (!!$script) Utils::throwError('20003:该剧本不存在!');
|
|
|
|
|
+ $script = (array)$script;
|
|
|
|
|
+ $script['roles'] = json_decode($script['roles']);
|
|
|
|
|
+ $script['scenes'] = json_decode($script['scenes']);
|
|
|
|
|
+
|
|
|
|
|
+ // 获取分集信息
|
|
|
|
|
+ $episodes = DB::table('mp_script_episodes')->where('script_id', $script_id)->orderBy('episode_number')
|
|
|
|
|
+ ->select('script_id', 'episode_number', 'title', 'content')
|
|
|
|
|
+ ->get()->map(function ($value) {
|
|
|
|
|
+ return (array)$value;
|
|
|
|
|
+ })->toArray();
|
|
|
|
|
+ $script['episodes'] = $episodes;
|
|
|
|
|
+ return $script;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function createScript($data) {
|
|
public function createScript($data) {
|
|
|
$script_name = getProp($data, 'script_name');
|
|
$script_name = getProp($data, 'script_name');
|
|
|
$uid = Site::getUid(); // 获取当前用户ID
|
|
$uid = Site::getUid(); // 获取当前用户ID
|
|
@@ -1220,9 +1239,9 @@ class DeepSeekService
|
|
|
'highlights' => isset($script_arr['highlights']) ? $script_arr['highlights'] : '',
|
|
'highlights' => isset($script_arr['highlights']) ? $script_arr['highlights'] : '',
|
|
|
'role_relationship' => isset($script_arr['role_relationship']) ? $script_arr['role_relationship'] : '',
|
|
'role_relationship' => isset($script_arr['role_relationship']) ? $script_arr['role_relationship'] : '',
|
|
|
'core_contradiction' => isset($script_arr['core_contradiction']) ? $script_arr['core_contradiction'] : '',
|
|
'core_contradiction' => isset($script_arr['core_contradiction']) ? $script_arr['core_contradiction'] : '',
|
|
|
- 'roles' => isset($script_arr['roles']) ? $script_arr['roles'] : '',
|
|
|
|
|
|
|
+ 'roles' => isset($script_arr['roles']) ? json_encode($script_arr['roles'], true) : '',
|
|
|
'art_style' => isset($script_arr['art_style']) ? $script_arr['art_style'] : '',
|
|
'art_style' => isset($script_arr['art_style']) ? $script_arr['art_style'] : '',
|
|
|
- 'scenes' => isset($script_arr['scenes']) ? $script_arr['scenes'] : '',
|
|
|
|
|
|
|
+ 'scenes' => isset($script_arr['scenes']) ? json_encode($script_arr['scenes'], true) : '',
|
|
|
'status' => 3,
|
|
'status' => 3,
|
|
|
'start_episode_sequence' => $start_episode_sequence,
|
|
'start_episode_sequence' => $start_episode_sequence,
|
|
|
'end_episode_sequence' => $start_episode_sequence + count($script_arr['episodes']) - 1,
|
|
'end_episode_sequence' => $start_episode_sequence + count($script_arr['episodes']) - 1,
|