mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 23:11:07 +03:30
change test result controller
This commit is contained in:
@@ -405,18 +405,27 @@ class TestResultController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($imagesDeleted)) {
|
// if (count($imagesDeleted)) {
|
||||||
foreach ($imagesDeleted as $key => $imageDeleted) {
|
// foreach ($imagesDeleted as $key => $imageDeleted) {
|
||||||
$Gallery = Gallery::where('path', $imageDeleted)->first();
|
// $Gallery = Gallery::where('path', $imageDeleted)->first();
|
||||||
if ($Gallery) {
|
// if ($Gallery) {
|
||||||
Storage::disk('public')->delete(static::storage_path($imageDeleted));
|
// Storage::disk('public')->delete(static::storage_path($imageDeleted));
|
||||||
Uploadable::where('gallery_id', $Gallery->id)->where('uploadable_id', $TestResult->id)->where('uploadable_type', get_class($TestResult))->delete();
|
// Uploadable::where('gallery_id', $Gallery->id)->where('uploadable_id', $TestResult->id)->where('uploadable_type', get_class($TestResult))->delete();
|
||||||
$Gallery->delete();
|
// $Gallery->delete();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (count($imagesDeleted)) {
|
||||||
|
foreach ($imagesDeleted as $key => $imageDeleted) {
|
||||||
|
$Gallery = Gallery::where('path', $imageDeleted)->first();
|
||||||
|
if ($Gallery) {
|
||||||
|
Storage::disk('public')->delete(static::storage_path($imageDeleted));
|
||||||
|
Uploadable::where('gallery_id', $Gallery->id)->where('uploadable_id', $TestResult->id)->where('uploadable_type', get_class($TestResult))->delete();
|
||||||
|
$Gallery->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return \MessageResponse::success(null,trans('messages.update'));
|
return \MessageResponse::success(null,trans('messages.update'));
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 118 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Reference in New Issue
Block a user