mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
remove exam, remove exam_user and exam_progress
This commit is contained in:
@@ -94,8 +94,12 @@ class ExamRepository extends BaseRepository
|
||||
public function delete($id)
|
||||
{
|
||||
$exam = Exam::query()->findOrFail($id);
|
||||
$result = $exam->delete();
|
||||
return $result;
|
||||
DB::transaction(function () use ($exam) {
|
||||
ExamUser::query()->where('exam_id', $exam->id)->delete();
|
||||
ExamProgress::query()->where('exam_id', $exam->id)->delete();
|
||||
$exam->delete();
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
public function listIndexes()
|
||||
|
||||
Reference in New Issue
Block a user