|
@ -47,9 +47,9 @@ class SearchController extends Controller |
|
|
foreach ($grains as $grain){ |
|
|
foreach ($grains as $grain){ |
|
|
$grainname = Grain::where('id', $grain->grain_id)->value('name'); |
|
|
$grainname = Grain::where('id', $grain->grain_id)->value('name'); |
|
|
if ($i == 0){ |
|
|
if ($i == 0){ |
|
|
$grainarr[]= array('id'=>$grain->grain_id, 'name'=>$grainname); |
|
|
|
|
|
|
|
|
$grainarr[]= array('id'=>$grain->grain_id, 'name'=>$grainname, 'amount'=>$grain->amount, 'grain_bill'=>$grain->grain_bill); |
|
|
} else { |
|
|
} else { |
|
|
array_push($grainarr, array('id'=>$grain->grain_id, 'name'=>$grainname)); |
|
|
|
|
|
|
|
|
array_push($grainarr, array('id'=>$grain->grain_id, 'name'=>$grainname, 'amount'=>$grain->amount, 'grain_bill'=>$grain->grain_bill)); |
|
|
}; |
|
|
}; |
|
|
$i++; |
|
|
$i++; |
|
|
}; |
|
|
}; |
|
|