diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index f72e360..bd1a405 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -264,7 +264,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; } } @@ -272,7 +272,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 e928dc2..2668573 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; @@ -715,6 +717,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')-> @@ -744,8 +752,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
{!! $company[0]->text !!}
+