Răsfoiți Sursa

升级版本

mead 1 lună în urmă
părinte
comite
33596e5034
1 a modificat fișierele cu 10 adăugiri și 2 ștergeri
  1. 10 2
      app/Console/Commands/InitCourseCommand.php

+ 10 - 2
app/Console/Commands/InitCourseCommand.php

@@ -147,6 +147,14 @@ class InitCourseCommand extends Command
 //            ],
 //        ];
 
+        $videos = Video::query()->whereIn('course_id', [16, 17])->get();
+
+        foreach ($videos as $video) {
+            $video->title = str_replace(['2024-01-14/zhongyao/', '.mp4'], '', $video->title);
+            $video->save();
+        }
+        dd(1);
+
         $data = [
             //推拿
             [
@@ -259,8 +267,8 @@ class InitCourseCommand extends Command
                         $s[0] = 'Videos';
                         $videos[$s[0]][] = [
                             'section' => $s[0],
-                            'name' => $name,
-                            'en_name' => $name,
+                            'name' => $fileArr['filename'],
+                            'en_name' => $fileArr['filename'],
                             'path' => "{$base_url}" . $file['key'],
                             'srt' => false
                         ];