|
@@ -195,17 +195,17 @@ class InitCourseCommand extends Command
|
|
|
|
|
|
|
|
|
|
$courses = [12, 13];
|
|
$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');
|
|
$this->line('ok');
|