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
{!! $company[0]->text !!}
+