|
@ -43,14 +43,12 @@ class SearchController extends Controller |
|
|
$i++; |
|
|
$i++; |
|
|
}; |
|
|
}; |
|
|
$grains = Grainbill::where('beer_id', $result->beer_id)->distinct('grain_id'); |
|
|
$grains = Grainbill::where('beer_id', $result->beer_id)->distinct('grain_id'); |
|
|
$result['grains']=array(); |
|
|
|
|
|
$i = 0; |
|
|
|
|
|
|
|
|
$grainarr = array(); |
|
|
foreach ($grains as $grain){ |
|
|
foreach ($grains as $grain){ |
|
|
$grainname = Grain::where('id', $grain->id)->value('name'); |
|
|
$grainname = Grain::where('id', $grain->id)->value('name'); |
|
|
$grainarr = array('id'=>$grain->id, 'name'=>$grainname); |
|
|
|
|
|
$result['grains'][] = $grainarr; |
|
|
|
|
|
$i++; |
|
|
|
|
|
|
|
|
$grainarr[] = array('id'=>$grain->id, 'name'=>$grainname); |
|
|
}; |
|
|
}; |
|
|
|
|
|
$result['grains'] = $grainarr; |
|
|
$yeasts = Fermentation::where('beer_id', $result->beer_id)->distinct('yeast_id'); |
|
|
$yeasts = Fermentation::where('beer_id', $result->beer_id)->distinct('yeast_id'); |
|
|
$result['yeasts']=[]; |
|
|
$result['yeasts']=[]; |
|
|
$i = 0; |
|
|
$i = 0; |
|
|