|
@@ -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');
|