вывел всех менеджеров на главной

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
developer 2026-05-08 16:41:12 +08:00
parent b9967776cd
commit f338780c45
2 changed files with 69 additions and 10 deletions

View File

@ -7,9 +7,16 @@
class CityManagerInfo extends Component
{
public $managers = [];
public $manager = false;
public function mount()
{
$availableCities = GetAvailableCities();
CityManager::whereIn('city_id', $availableCities->pluck('id'))->get()->each(function ($cityManager) {
$this->managers[] = $cityManager->user;
});
//depricated, but leave for now, maybe will be used in future for list of managers in city
$city = false;
if (($company = AdminCompanyOfUser()) || ($company = AgentCompanyOfUser()))
{

View File

@ -1,5 +1,56 @@
<div>
@if ($manager)
@if($managers)
@php
$cardBg = array_key_exists('primary_color', DESIGN_PARAMETERS)
? DESIGN_PARAMETERS['primary_color'] . '50'
: 'gray';
@endphp
<style>
#carouselExampleCaptions {
max-width: 300px;
overflow: hidden;
}
.carousel-item {
width: 300px;
}
.carousel-item .card {
background-color: {{ $cardBg }};
padding: 0 35px;
}
</style>
<div id="carouselExampleCaptions" class="carousel slide rounded-2">
<div class="carousel-inner">
@foreach($managers as $manager)
<div class="carousel-item {{ $loop->first ? 'active' : '' }}">
<div class="carousel-content">
<div class="card rounded-0 border-0">
<div class="fw-bold text-uppercase text-primary text-truncate">
{{ $manager->name }}
</div>
<div class="d-flex flex-column gap-1 fs-6">
<span><i class="bi bi-telephone-fill"></i> {{ $manager->phone }}</span>
<span><i class="bi bi-envelope-fill"></i> {{ $manager->email }}</span>
</div>
</div>
</div>
</div>
@endforeach
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
@endif
@if ($manager && 1 == 2)
<div class="vstack gap-1">
<div>
<div class="text-secondary">Ваш менеджер:</div>
@ -13,4 +64,5 @@
</div>
</div>
@endif
</div>