Fix saving marhun photo file to correct directory

This commit is contained in:
afiq.hamzah
2022-11-27 15:15:44 +08:00
parent 2c6b80c345
commit 578338b05d
3 changed files with 9 additions and 10 deletions
+3 -2
View File
@@ -517,6 +517,7 @@ class MarhunController extends Controller
{
$lelongbid = LelongBid::where('id', '=', $id)->first();
$norujukan_sag = $lelongbid->norujukan;
$filemarhun = FileMarhun::where('lelongbid_id', '=', $lelongbid['id'])
->where('photo_type', '=', '1')
->first();
@@ -537,7 +538,7 @@ class MarhunController extends Controller
foreach ($marhun as $index) {
$eachmarhun = FileMarhun::where('lelongbidmarhun_id', '=', $index['id'])->first();
if (isset($eachmarhun)) {
$index->eachmarhun_filename = route('marhun.showphotomarhun', ['lelong_id' => $lelong_id, 'filemarhun_id' => $eachmarhun]);
$index->eachmarhun_filename = route('marhun.showphotomarhun', ['norujukan_sag' => $norujukan_sag, 'filemarhun_id' => $eachmarhun]);
$index->eachmarhun_id = $eachmarhun->id;
}
@@ -2258,7 +2259,7 @@ class MarhunController extends Controller
public function showPhotoMarhun(Request $request)
{
$marhun = FileMarhun::where('id', '=', $request->filemarhun_id)->first();
return $this->marhunPhotoService->show($request->lelong_id, $marhun);
return $this->marhunPhotoService->show($request->norujukan_sag, $marhun);
}