From e8fb1dab9391bcc8b053732cfbeca59198967893 Mon Sep 17 00:00:00 2001 From: Amir Date: Mon, 6 Feb 2023 13:07:26 +0800 Subject: [PATCH] Add new command kemaskiniCawanganLelong --- .../Commands/kemaskiniCawanganLelong.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 app/Console/Commands/kemaskiniCawanganLelong.php diff --git a/app/Console/Commands/kemaskiniCawanganLelong.php b/app/Console/Commands/kemaskiniCawanganLelong.php new file mode 100644 index 00000000..ca9fd2ba --- /dev/null +++ b/app/Console/Commands/kemaskiniCawanganLelong.php @@ -0,0 +1,57 @@ +select('id')->get(); + foreach($lelong as $lel) + { + foreach($lel->cawangan as $caw) + { + $lelong_bid = LelongBid::where('kodcaw', $caw->caw_code)->where('lelong_id', $lel->id)->first(); + if($lelong_bid == null) + { + CawanganLelong::where('caw_id', $caw->id)->where('lelong_id', $lel->id)->delete(); + } + } + } + } +}