mead 2 mesi fa
parent
commit
b0544a30a1
1 ha cambiato i file con 10 aggiunte e 10 eliminazioni
  1. 10 10
      app/Console/Commands/InitCourseCommand.php

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

@@ -195,17 +195,17 @@ class InitCourseCommand extends Command
 
 
         $courses = [12, 13];
-        foreach ($courses as $i) {
-            $t = Video::query()->where('course_id', $i)->count();
-            $this->line("total:{$t}");
-            $data = file_get_contents(base_path('data/youjihuaxueshuangyu.json'));
-            $data = json_decode($data, true);
-            foreach ($data['Videos'] as $k => $v) {
-                $sort = $t - $k;
-                $this->line("{$v['name']}==>{$sort}");
-                Video::query()->where('course_id', 'in', $courses)->where('title', $v['name'])->update(['sort' => $sort]);
-            }
+//        foreach ($courses as $i) {
+        $t = Video::query()->where('course_id', 12)->count();
+        $this->line("total:{$t}");
+        $data = file_get_contents(base_path('data/youjihuaxueshuangyu.json'));
+        $data = json_decode($data, true);
+        foreach ($data['Videos'] as $k => $v) {
+            $sort = $t - $k;
+            $this->line("{$v['name']}==>{$sort}");
+            Video::query()->where('course_id', 'in', $courses)->where('title', $v['name'])->update(['sort' => $sort]);
         }
+//        }
 
 
         $this->line('ok');