Fix cannot update upload overall marhun photo

This commit is contained in:
afiq.hamzah
2022-11-24 14:19:24 +08:00
parent f6f0cca41c
commit 50ca8f58bf
3 changed files with 9 additions and 9 deletions
+4 -6
View File
@@ -515,6 +515,7 @@ class MarhunController extends Controller
public function show($id, $lelong_id)
{
$lelongbid = LelongBid::where('id', '=', $id)->first();
$filemarhun = FileMarhun::where('lelongbid_id', '=', $lelongbid['id'])
->where('photo_type', '=', '1')
@@ -540,16 +541,13 @@ class MarhunController extends Controller
$index->eachmarhun_id = $eachmarhun->id;
}
/**
* FIXME:
* Status here need to clarify
*/
$status = Pengesahan::where('lelongbid_id', $id)
->where('lelong_id', $lelongbid['lelong_id'])
->first();
// dd($status);
// $marhun[$index->status_semak] = $status;
// dd($status);
$index->status = $status;
}
+3 -1
View File
@@ -5,6 +5,7 @@ namespace App\Services;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use App\Models\FileMarhun;
use App\Models\LelongBid;
class MarhunPhotoService
{
@@ -12,6 +13,7 @@ class MarhunPhotoService
public function store(Request $request)
{
$file_type = $request->gambarMarhun->extension();
$addfile = new FileMarhun();
@@ -52,7 +54,7 @@ class MarhunPhotoService
$marhunImageFileName = "overall.{$imageExtension}";
if (!empty($request->lelongbidmarhund_id)) {
if (!empty($request->lelongbidmarhun_id)) {
$marhunImageFileName = "$lelongbidmarhun_id.$imageExtension";
}
+2 -2
View File
@@ -429,8 +429,8 @@
$imageLink = route('marhun.showphotomarhun', ['lelong_id' => $lelongbid['lelong_id'], 'filemarhun_id' => $lelongbid['filemarhun_id']]);
@endphp
<a href="{{ $imageLink }}" target="_blank" class="btn m-2 btn-warning">Lihat gambar</a>
<button data-dismiss="modal"
type="button" class="btn m-2 btn-warning">Muat naik gambar baru</button>
<button data-dismiss="modal" onclick="updatePhoto(1)" type="button"
data-target="#modalupdatephoto" data-toggle="modal" class="btn m-2 btn-warning">Muat naik gambar baru</button>
<button data-dismiss="modal"
onclick="modalOverallPhotoCaptureUpdate.initiateTakeMarhunPhoto()" type="button"
class="btn m-2 btn-warning">Ambil Gambar Baru</button>