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 }}