Merge branch 'main' into atie

This commit is contained in:
Nur Izzati Zulkifli
2022-04-17 13:09:22 +08:00
3 changed files with 22 additions and 21 deletions
+7 -6
View File
@@ -535,8 +535,9 @@ class MarhunController extends Controller
{
$lelongbidmarhuns = LelongBidMarhun::join('pengesahan', 'lelongbidmarhun.lelongbid_id', '=', 'pengesahan.lelongbid_id')
->where('pengesahan.lelongbid_id', $pengesahan->lelongbid_id)
->where('pengesahan.id', $request->pengesahan_id)
->where('pengesahan.id', $pengesahan->id)
->get();
dd($lelongbidmarhuns['marhun']);
foreach($lelongbidmarhuns as $bidmarhuns)
{
@@ -551,19 +552,19 @@ class MarhunController extends Controller
}
$pengesahan = Pengesahan::join('lelongbidmarhun', 'pengesahan.lelongbid_id', '=', 'lelongbidmarhun.lelongbid_id')
->where('pengesahan.lelongbid_id', $lelongbid_id)
->where('pengesahan.lelongbid_id', $pengesahan->lelongbid_id)
->select('pengesahan.id as pengesahan_id')
->first();
$marhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbid_id','=',$lelongbid_id)
->where('lelongbid_id','=',$pengesahan->lelongbid_id)
->get();
$lelongbid = LelongBid::where('id', $lelongbid_id)->first();
$lelongbid = LelongBid::where('id', $pengesahan->lelongbid_id)->first();
$txtmarhun = ",1 " . $lelongbidmarhuns->marhun ;
$lelongbid->marhun = str_replace( $txtmarhun,"",$lelongbid->marhun);
$lelongbid->berat = $lelongbid->berat - $lelongbidmarhuns->berat_emastambahan;
$lelongbid->hargaasas = $lelongbid->hargaasas - $lelongbidmarhuns->harga_asastambahan;
$lelongbid->berat = $lelongbid->berat - $lelongbidmarhuns->berat;
$lelongbid->hargaasas = $lelongbid->hargaasas - $lelongbidmarhuns->hargaasas;
$lelongbid->save();
// $this->pcdelete($request->pengesahan_id, $pengesahan->lelongbid_id);
@@ -27,17 +27,17 @@ class CreatePengesahanTable extends Migration
$table->integer('status_ubah')->default(0); //1 = ubah mutu, 2 = tambah marhun, 3 = hapus marhun, 4 = ubah berat, 5 = ubah mutu & berat
$table->timestamps();
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
// $table->foreign('lelong_id')
// ->references('id')->on('lelong')
// ->onDelete('cascade');
$table->foreign('lelongbid_id')
->references('id')->on('lelongbid')
->onDelete('cascade');
// $table->foreign('lelongbid_id')
// ->references('id')->on('lelongbid')
// ->onDelete('cascade');
$table->foreign('lelongbidmarhun_id')
->references('id')->on('lelongbidmarhun')
->onDelete('cascade');
// $table->foreign('lelongbidmarhun_id')
// ->references('id')->on('lelongbidmarhun')
// ->onDelete('cascade');
});
}
@@ -25,13 +25,13 @@ class CreateTangguhlelongTable extends Migration
$table->string('nota');
$table->timestamps();
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
// $table->foreign('lelong_id')
// ->references('id')->on('lelong')
// ->onDelete('cascade');
$table->foreign('lelongbid_id')
->references('id')->on('lelongbid')
->onDelete('cascade');
// $table->foreign('lelongbid_id')
// ->references('id')->on('lelongbid')
// ->onDelete('cascade');
});
}