Show tarikh_lelong when select batch component

This commit is contained in:
Amir
2023-02-08 12:06:45 +08:00
parent 483f5a9e68
commit a9e53a4bc1
2 changed files with 7 additions and 2 deletions
@@ -1433,7 +1433,12 @@ class LelongMobileController extends Controller
public function listLelong()
{
$lelong_all = Lelong::select('id')->get();
$lelong_all = Lelong::select('id', 'tarikh_lelong')->get();
foreach($lelong_all as $index => $lelong)
{
$date_convert = strtotime($lelong->tarikh_lelong);
$lelong_all[$index]['tarikh_lelong'] = date("d-m-Y", $date_convert);
}
return response()->json($lelong_all);
}
@@ -8,7 +8,7 @@
<label>Pilih Batch Lelong</label>
<select class="custom-select" @change="pilihBatchLelong($event)">
<option selected>Batch Lelong</option>
<option v-for="val in listLelong" :key="val" v-bind:value="val.id">{{ val.id }}</option>
<option v-for="val in listLelong" :key="val" v-bind:value="val.id">{{ val.id }}, ({{ val.tarikh_lelong }})</option>
</select>
<div class="mt-3">
<SelectCawangan v-if="pilihLelong != 'Batch Lelong'" v-bind:key="componentKey" v-bind:selectedLelong="pilihLelong" />