diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index 397ff69..158afda 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -28,9 +28,13 @@ class CompanyController extends Controller default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; } } + if (is_null($request->get('sort'))){ - $emps = $emps->paginate(4); + $emps = $emps->orderByDesc('created_at')->orderBy('id'); + + } + $emps = $emps->paginate(4); if ($request->ajax()) { if ($request->get('block') == '1') diff --git a/resources/views/companies.blade.php b/resources/views/companies.blade.php index 5db8895..4a62d0e 100644 --- a/resources/views/companies.blade.php +++ b/resources/views/companies.blade.php @@ -107,7 +107,7 @@ По имени (возрастание) По имени (убывание) По дате (возрастание) - По дате (убывание) + По дате (убывание) diff --git a/resources/views/detail_new.blade.php b/resources/views/detail_new.blade.php index 85d19c2..abf3227 100644 --- a/resources/views/detail_new.blade.php +++ b/resources/views/detail_new.blade.php @@ -63,7 +63,7 @@ @endif {{ date('d.m.Y H:i:s', strtotime($Query[0]->created_at)) }} {{ $title }} - {{ mb_strimwidth($Query[0]->text, 0, 100, "...") }} + {!! mb_strimwidth($Query[0]->text, 0, 100, "...") !!} diff --git a/resources/views/info_company_new.blade.php b/resources/views/info_company_new.blade.php index 6dfa0e6..3ac9375 100644 --- a/resources/views/info_company_new.blade.php +++ b/resources/views/info_company_new.blade.php @@ -153,7 +153,9 @@ Сайт - {{ $company[0]->site }} + + {{$company[0]->site}} +
{{ mb_strimwidth($Query[0]->text, 0, 100, "...") }}
{!! mb_strimwidth($Query[0]->text, 0, 100, "...") !!}