dowload wip
This commit is contained in:
1 parent
b004542988
commit
8971b8b948
41 files changed
+2103
-243
No files matched your search
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Generate\Nutzwerte;
|
||||
|
||||
use App\Models\Orientierung;
|
||||
use App\Models\Raumalles;
|
||||
use App\Models\Raumorientierung;
|
||||
|
||||
class Zusammenstellung_Methode1
|
||||
{
|
||||
public static function load($projekts_id)
|
||||
{
|
||||
$res = Raumalles::select('raumorientierung_id', 'geschoss')->where('projekts_id', $projekts_id)->where('methodes_id', '1')->groupBy('raumorientierung_id', 'geschoss')->get();
|
||||
$geschoss = [];
|
||||
$raumorientierung_ids = [];
|
||||
foreach ($res as $value) {
|
||||
$geschoss[$value->raumorientierung_id][] = $value->geschoss;
|
||||
$raumorientierung_ids[] = $value->raumorientierung_id;
|
||||
}
|
||||
|
||||
$orientierung = Orientierung::map();
|
||||
$orientierung[1] = '';
|
||||
|
||||
$res = Raumorientierung::where('projekts_id', $projekts_id)->whereIn('id', $raumorientierung_ids)->orderBy('top_nr')->get();
|
||||
|
||||
$return = [];
|
||||
foreach ($res as $value) {
|
||||
$tmp = [];
|
||||
$tmp['id'] = $value->id;
|
||||
$tmp['top_nr'] = $value->top_nr;
|
||||
$tmp['type'] = $value->type;
|
||||
$tmp['nutzwert_summe'] = $value->nutzwert_summe;
|
||||
$tmp['orientierung'] = $orientierung[$value->orientierungs_id];
|
||||
$tmp['geschoss'] = '';
|
||||
if (isset($geschoss[$value['id']])) {
|
||||
$tmp['geschoss'] = implode(',', $geschoss[$value->id]);
|
||||
}
|
||||
$return[] = $tmp;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user