From 7f2872aa3c0c34643c06e014811a3f380f8d4ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Thu, 16 May 2024 22:14:39 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=20=D0=A0=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B0-=D1=81=D1=80=D0=B5=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/MainController.php | 4 +-- app/Http/Controllers/WorkerController.php | 12 +++++-- resources/views/employers/dialog.blade.php | 50 +++++++++++++++++++++++++--- resources/views/info_company_new.blade.php | 2 +- resources/views/worker.blade.php | 1 - resources/views/workers/dialog.blade.php | 47 +++++++++++++++++++++++--- 6 files changed, 101 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index cf80934..2ed65ba 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -263,7 +263,7 @@ class MainController extends Controller case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; - default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; + default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break; } } @@ -271,7 +271,7 @@ class MainController extends Controller $Query_count = $Query->count(); - $Query = $Query->OrderBy('updated_at')->paginate(3); + $Query = $Query->OrderByDesc('updated_at')->paginate(3); $Reclama = reclame::query()->get(); diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index c54248c..d9194d7 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -171,6 +171,7 @@ class WorkerController extends Controller $Query = $Query->get(); $get_date = date('Y.m'); + $c = Static_worker::query()->where('year_month', '=', $get_date) ->where('user_id', '=', $worker->user_id) ->get(); @@ -252,9 +253,10 @@ class WorkerController extends Controller $Infoblocks = infobloks::query()->OrderBy('name')->get(); $stat = Static_worker::query()->where('year_month', '=', $get_date) - ->where('user_id', '=', $Worker[0]->id) + ->where('user_id', '=', $id) ->get(); + // 10% $persent = 10; @@ -714,6 +716,12 @@ class WorkerController extends Controller $ad_employer = 0; } + if (isset($user1->id)) { + $sender = User_Model::query()->with('workers')-> + with('employers')-> + where('id', $user1->id)->first(); + } + if (isset($user2->id)) { $companion = User_Model::query()->with('workers')-> with('employers')-> @@ -743,8 +751,6 @@ class WorkerController extends Controller //$ad_employer = null; //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); - $sender = $user1; - return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); } diff --git a/resources/views/employers/dialog.blade.php b/resources/views/employers/dialog.blade.php index 9d3c554..5cd48eb 100644 --- a/resources/views/employers/dialog.blade.php +++ b/resources/views/employers/dialog.blade.php @@ -83,7 +83,12 @@ - + @if ((isset($companion->workers[0]->photo)) && + (!empty($companion->workers[0]->photo))) + + @else + + @endif
{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }}
@@ -112,7 +117,12 @@ - + @if ((isset($companion->employers[0]->logo)) && + (!empty($companion->employers[0]->logo))) + + @else + + @endif
{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }}
@@ -139,7 +149,23 @@ - + + @if ($companion->is_worker) + @if ((isset($companion->workers[0]->photo)) && + (!empty($companion->workers[0]->photo))) + + @else + + @endif + @else + @if ((isset($companion->employers[0]->logo)) && + (!empty($companion->employers[0]->logo))) + + @else + + @endif + @endif +
{{ $it->text }}
@@ -152,7 +178,23 @@ - + + @if ($sender->is_worker) + @if ((isset($sender->workers[0]->photo)) && + (!empty($sender->workers[0]->photo))) + + @else + + @endif + @else + @if ((isset($sender->employers[0]->logo)) && + (!empty($sender->employers[0]->logo))) + + @else + + @endif + @endif +
{{ $it->text }}
diff --git a/resources/views/info_company_new.blade.php b/resources/views/info_company_new.blade.php index b9f63fc..5eca8af 100644 --- a/resources/views/info_company_new.blade.php +++ b/resources/views/info_company_new.blade.php @@ -106,7 +106,7 @@ @endif

{{ $company[0]->name_company }}

-

{!! $company[0]->text !!}

+
{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }}
@@ -104,7 +109,12 @@ - + @if ((isset($companion->employers[0]->logo)) && + (!empty($companion->employers[0]->logo))) + + @else + + @endif
{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }}
@@ -131,7 +141,21 @@ - + @if ($companion->is_worker) + @if ((isset($companion->workers[0]->photo)) && + (!empty($companion->workers[0]->photo))) + + @else + + @endif + @else + @if ((isset($companion->employers[0]->logo)) && + (!empty($companion->employers[0]->logo))) + + @else + + @endif + @endif
{{ $it->text }}
@@ -144,7 +168,22 @@ - + @if ($sender->is_worker) + @if ((isset($sender->workers[0]->photo)) && + (!empty($sender->workers[0]->photo))) + + @else + + @endif + @else + @if ((isset($sender->employers[0]->logo)) && + (!empty($sender->employers[0]->logo))) + + @else + + @endif + @endif +
{{ $it->text }}
-- 1.7.10.4