File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,18 +51,6 @@ public function migrate_action()
5151
5252 $ actionStatus = $ this ->migrateCourseware ($ cid );
5353
54- if ($ actionStatus ['code ' ] === 200 ) {
55- $ MigrationStatus = \Mooc \DB \MigrationStatus::findOneBySQL ('seminar_id = ? ' , array ($ cid ));
56- if ($ MigrationStatus !== null ) {
57- $ MigrationStatus ->delete ();
58- }
59- $ MigrationStatus = \Mooc \DB \MigrationStatus::build ([
60- 'seminar_id ' => $ cid ,
61- 'mkdate ' => time ()
62- ]);
63- $ MigrationStatus ->store ();
64- }
65-
6654 $ this ->response ->add_header ('Content-Type ' , 'application/json ' );
6755 $ this ->render_text (json_encode ($ actionStatus ));
6856 }
@@ -94,6 +82,10 @@ private function migrateCourse($courseware)
9482 $ courseware = current ($ grouped ['' ]);
9583 $ this ->buildTree ($ grouped , $ courseware );
9684 $ this ->createNewCourseware ($ courseware );
85+ $ migrationStatus = \Mooc \DB \MigrationStatus::findOneBySQL ('seminar_id = ? ' , array ($ cid ));
86+ if ($ migrationStatus !== null ) {
87+ $ migrationStatus ->delete ();
88+ }
9789 $ status = \Mooc \DB \MigrationStatus::build ([
9890 'seminar_id ' => $ cid ,
9991 'mkdate ' => time ()
You can’t perform that action at this time.
0 commit comments