This commit is contained in:
Azfar Arsyad
2021-12-28 17:02:12 +08:00
parent 6b53072fee
commit 7e7bcc5521
5 changed files with 16 additions and 2 deletions
+11
View File
@@ -227,6 +227,7 @@ class LelongController extends Controller
$cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get();
$simkarat = SimKarat::where('simulasi_id','=',$id)->get();
$lelong = new Lelong();
$lelong->tarikh_lelong = $simulasi->tarikh_lelong;
$lelong->harga_emas_asas = $simulasi->harga_emas_asas;
@@ -247,7 +248,17 @@ class LelongController extends Controller
foreach($cawangansim as $caw)
{
$cawanganlel = CawanganLelong::where('caw_id','=',$caw->caw_id)->orderBy('id','desc')->first();
if($cawanganlel)
{
$batchno = $cawanganlel->batchlel+1;
}
else
{
$batchno = 1;
}
$caw_lelong = new CawanganLelong;
$caw_lelong->batchlel = $batchno;
$caw_lelong->lelong_id = $lelong->id;
$caw_lelong->caw_id = $caw->caw_id;
$caw_lelong->online = $caw->online;