This commit is contained in:
Jerry Yan 2024-06-08 21:38:38 +08:00
parent 31c21e3a04
commit cec896abbf

View File

@ -110,7 +110,7 @@ class ProgramConstructController extends BaseController
$program->name = trim($match["content"]); $program->name = trim($match["content"]);
$video_pivot = new ProgramVideos(); $video_pivot = new ProgramVideos();
$video_pivot->video_bvid = $bvid; $video_pivot->video_bvid = $bvid;
$video_pivot->start_part = $match["part"] ?? 1; $video_pivot->start_part = empty($match["part"]) ? 1 : $match["part"];
$video_pivot->start_time = $time; $video_pivot->start_time = $time;
$program->save(); $program->save();
$program->video_pivots()->save($video_pivot); $program->video_pivots()->save($video_pivot);