Continue MMC

This commit is contained in:
Александр Бабкин
2022-07-14 11:01:44 +03:00
parent 30950a120e
commit 97bacd4423
10 changed files with 158 additions and 24 deletions

View File

@@ -4,6 +4,9 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Project;
use App\Models\AUK;
use App\Models\Document;
class MMCController extends Controller
{
@@ -17,7 +20,12 @@ class MMCController extends Controller
{
$project_id = $request->session()->get('project_id');
$project = Project::find($project_id);
return view('mmc.list', ['project' => $project]);
$top_auks = $project->auks()->where('parent_id', 0)->get()->sortBy('auk_name');
if(count($top_auks))
{
$mmc = $top_auks[0]->mmcs;
}
return view('mmc.list', ['project' => $project, 'top_auks' => $top_auks]);
}
/**