Fix saving marhun photo file to correct directory
This commit is contained in:
@@ -28,7 +28,7 @@ class MarhunPhotoService
|
||||
$addfile->save();
|
||||
}
|
||||
|
||||
$no_rujukan_sag = LelongBid::select('norujukan')->where('lelong_id', $request->lelong_id)->first()->norujukan;
|
||||
$no_rujukan_sag = LelongBid::select('norujukan')->where('id', $request->lelongbid_id)->first()->norujukan;
|
||||
$photo_type_name = $request->photo_type === '1' ? 'overall_photo' : 'by_marhun_photo';
|
||||
|
||||
$directory = "/{$no_rujukan_sag}/{$photo_type_name}/";
|
||||
@@ -47,7 +47,7 @@ class MarhunPhotoService
|
||||
{
|
||||
$deleteFile = FileMarhun::where('id', '=', $request->filemarhun_id)->first();
|
||||
|
||||
$no_rujukan_sag = LelongBid::select('norujukan')->where('lelong_id', $request->lelong_id)->first()->norujukan;
|
||||
$no_rujukan_sag = LelongBid::select('norujukan')->where('id', $request->lelongbid_id)->first()->norujukan;
|
||||
$photo_type_name = $request->photo_type === '1' ? 'overall_photo' : 'by_marhun_photo';
|
||||
|
||||
$directory = "/{$no_rujukan_sag}/{$photo_type_name}/";
|
||||
@@ -65,15 +65,13 @@ class MarhunPhotoService
|
||||
$deleteFile->delete();
|
||||
}
|
||||
|
||||
public function show($lelong_id, $marhun)
|
||||
public function show($norujukan_sag, $marhun)
|
||||
{
|
||||
$lelongbidmarhun_id = $marhun->lelongbidmarhun_id;
|
||||
$lelong_id = $lelong_id;
|
||||
|
||||
$no_rujukan_sag = LelongBid::select('norujukan')->where('lelong_id', $lelong_id)->first()->norujukan;
|
||||
$photo_type_name = $marhun->photo_type === 1 ? 'overall_photo' : 'by_marhun_photo';
|
||||
|
||||
$directory = "/{$no_rujukan_sag}/{$photo_type_name}/";
|
||||
$directory = "/{$norujukan_sag}/{$photo_type_name}/";
|
||||
$imageExtension = $marhun->file_type;
|
||||
|
||||
$marhunImageFileName = "overall.{$imageExtension}";
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="card-body" style="align-self: center; justify-content: center;">
|
||||
@if ($lelongbid['filemarhun_filename'] != null)
|
||||
<button type="button" data-toggle="modal" onclick="kesulurahanMarhunData(this)" data-lelongid="{{$lelongbid['lelong_id']}}" data-lelongbidid="{{$lelongbid['id']}}" data-fileid="{{ $lelongbid['filemarhun_id'] }}" data-target="#modaloverallphoto">
|
||||
<img src="{{ route('marhun.showphotomarhun', ['lelong_id' => $lelongbid['lelong_id'], 'filemarhun_id' => $lelongbid['filemarhun_id']]) }}" width="100%">
|
||||
<img src="{{ route('marhun.showphotomarhun', ['norujukan_sag' => $lelongbid['norujukan_sag'], 'filemarhun_id' => $lelongbid['filemarhun_id']]) }}" width="100%">
|
||||
</button>
|
||||
@else
|
||||
<p>Tiada Data</p>
|
||||
|
||||
Reference in New Issue
Block a user