Browse Source

升级版本

mead 2 months ago
parent
commit
ec21b4ac04

+ 11 - 3
app/Console/Commands/InitCourseCommand.php

@@ -195,7 +195,6 @@ class InitCourseCommand extends Command
 
 
         $courses = [12, 13];
-//        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'));
@@ -204,9 +203,18 @@ class InitCourseCommand extends Command
             $sort = $t - $k;
             $this->line("{$v['name']}==>{$sort}");
             Video::query()->whereIn('course_id', $courses)->where('title', $v['name'])->update(['sort' => $sort]);
-//            dd($aa);
         }
-//        }
+
+        $courses = [14, 15];
+        $t = Video::query()->where('course_id', 12)->count();
+        $this->line("total:{$t}");
+        $data = file_get_contents(base_path('data/zhongyiwenhua-jingluoshuxuanxue.json'));
+        $data = json_decode($data, true);
+        foreach ($data['Videos'] as $k => $v) {
+            $sort = $t - $k;
+            $this->line("{$v['name']}==>{$sort}");
+            Video::query()->whereIn('course_id', $courses)->where('title', $v['name'])->update(['sort' => $sort]);
+        }
 
 
         $this->line('ok');

+ 1 - 1
app/Repositories/Models/Course/Video.php

@@ -21,7 +21,7 @@ class Video extends Model implements Transformable
 
     protected static function booted()
     {
-        self::language();
+//        self::language();
     }
 
     /**