From f67ca478a49c9437614fba9e57156bfcf8708839 Mon Sep 17 00:00:00 2001 From: Amir Date: Mon, 26 Sep 2022 10:32:34 +0800 Subject: [PATCH] fix pengesahan function --- app/Models/LelongBidMarhun.php | 4 ++++ .../2022_03_07_061858_create_pengesahan_table.php | 3 +++ resources/views/marhun/marhun.blade.php | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/app/Models/LelongBidMarhun.php b/app/Models/LelongBidMarhun.php index ecb0ed06..679f70ce 100644 --- a/app/Models/LelongBidMarhun.php +++ b/app/Models/LelongBidMarhun.php @@ -22,4 +22,8 @@ class LelongBidMarhun extends Model 'n_marhun', 'hargaasas', ]; + + public function pengesahan() { + return $this->hasOne(Pengesahan::class, 'lelongbidmarhun_id'); + } } diff --git a/database/migrations/2022_03_07_061858_create_pengesahan_table.php b/database/migrations/2022_03_07_061858_create_pengesahan_table.php index 17859029..97bd6523 100644 --- a/database/migrations/2022_03_07_061858_create_pengesahan_table.php +++ b/database/migrations/2022_03_07_061858_create_pengesahan_table.php @@ -25,6 +25,9 @@ class CreatePengesahanTable extends Migration $table->datetime('diminta_pada'); $table->integer('status')->default(0); //1 = terima, 2 = tangguh lelong $table->integer('status_ubah')->default(0); //1 = ubah mutu, 2 = tambah marhun, 3 = hapus marhun, 4 = ubah berat, 5 = ubah mutu & berat, 6 = tangguh lelong pc + $table->string('request_berat')->nullable(); + $table->string('request_karat')->nullable(); + $table->string('request_marhun')->nullable(); $table->timestamps(); }); diff --git a/resources/views/marhun/marhun.blade.php b/resources/views/marhun/marhun.blade.php index 5def0387..e3dd1738 100644 --- a/resources/views/marhun/marhun.blade.php +++ b/resources/views/marhun/marhun.blade.php @@ -114,6 +114,18 @@ {{ $item->nota }} @if($lelongbid->status_semak == 1) + @elseif(isset($item->pengesahan)) + @if($item->pengesahan['status_ubah'] == 1) + Tunggu Pengesahan
Ubah Mutu
+ @elseif($item->pengesahan['status_ubah'] == 2) + Tunggu Pengesahan
Tambah Marhun
+ @elseif($item->pengesahan['status_ubah'] == 3) + Tunggu Pengesahan
Hapus Marhun
+ @elseif($item->pengesahan['status_ubah'] == 4) + Tunggu Pengesahan
Ubah Berat
+ @elseif($item->pengesahan['status_ubah'] == 5) + Tunggu Pengesahan
Ubah Mutu & Berat
+ @endif @else