diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index 5d9f733..052e61e 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -277,8 +277,7 @@ class WorkerController extends Controller $query = User::select($columns) ->leftJoin('workers', 'users.id', '=', 'workers.user_id') ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id') - ->where('users.is_bd', '=', 1) - ; + ->where('users.is_bd', '=', 1); $job_title_list = $request->input('job_title_list', []); if (!empty($job_title_list)){ @@ -320,16 +319,16 @@ class WorkerController extends Controller $Infobloks = infobloks::query()->get(); - $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> - with('infobloks')->with('place_worker')-> - WhereHas('users', - function (Builder $query) use ($id) {$query->Where('id', $id); + $Worker = Worker::query() + ->with(['users', 'sertificate', 'prev_company', 'infobloks', 'place_worker']) + ->WhereHas('users', function (Builder $query) use ($id) { + $query->Where('id', $id); })->get(); - $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> - where('is_bd', '=' , '1')-> - OrderByDesc('sort')->OrderBy('name')->get(); - + $Job_titles = Job_title::query()->where('is_remove', '=', '0') + ->where('is_bd', '=' , '1') + ->OrderByDesc('sort')->OrderBy('name') + ->get(); $stat = Static_worker::query()->where('year_month', '=', $get_date) ->where('user_id', '=', $id) @@ -781,16 +780,22 @@ class WorkerController extends Controller $Query = Ad_employer::query()->where('id', '=', '0'); } - $Query = $Query->with('jobs')-> - with('cat')-> - with('employer')-> - whereHas('jobs_code', function ($query) use ($request) { - if ($request->ajax()) { - if (null !== ($request->get('job'))) { - $query->where('job_title_id', $request->get('job')); + $Query = $Query->with(['jobs', 'cat', 'employer']) + ->whereHas('jobs_code', function ($query) use ($request) { + if ($request->ajax()) { + if (null !== ($request->get('job'))) { + $query->where('job_title_id', $request->get('job')); + } } - } - })->select('ad_employers.*'); + }) + ->select('ad_employers.*'); + + if ($request->get('search') !== null) { + $search = $request->get('search'); + $Query->where('name', 'LIKE', "%$search%"); + } + + //dd($Query->get()); $Job_title = Job_title::query()->OrderBy('name')->get(); @@ -798,7 +803,6 @@ class WorkerController extends Controller $Query = $Query->OrderBy('updated_at')->paginate(3); - return view('workers.favorite', compact('Query', 'Query_count', 'Job_title')); diff --git a/config/database.php b/config/database.php index c2e215d..9f5df8b 100644 --- a/config/database.php +++ b/config/database.php @@ -56,7 +56,7 @@ return [ 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, - 'strict' => true, + //'strict' => true, 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC', 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), diff --git a/public/images/sprite.svg b/public/images/sprite.svg index 9786335..db6ecd3 100644 --- a/public/images/sprite.svg +++ b/public/images/sprite.svg @@ -46,7 +46,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/resources/views/admin/job_titles/index.blade.php b/resources/views/admin/job_titles/index.blade.php index 4b11e1f..57dcb88 100644 --- a/resources/views/admin/job_titles/index.blade.php +++ b/resources/views/admin/job_titles/index.blade.php @@ -2,7 +2,6 @@ @section('script') @include('js.favorite-vacancy-45') @endsection @@ -109,12 +115,14 @@

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

- + + + @if ($user_id == 0) Написать сообщение @@ -186,13 +194,12 @@
- - + +
-
+
@if ($company[0]->flots->count()) @foreach ($company[0]->flots as $flot) @@ -217,7 +224,7 @@
-
+
@foreach ($ads as $job)
diff --git a/resources/views/js/captha.blade.php b/resources/views/js/captha.blade.php index 6301c3e..3aefe09 100644 --- a/resources/views/js/captha.blade.php +++ b/resources/views/js/captha.blade.php @@ -7,9 +7,6 @@ var captha1 = $('#captcha1').html(); var captha2 = $('#captcha2').html(); - console.log('captha1='+captha1); - console.log('captha2='+captha2); - document.getElementById('captcha1').innerHTML = ""; document.getElementById('captcha2').innerHTML = ""; var charsArray = diff --git a/resources/views/js/favorite-vacancy-45.blade.php b/resources/views/js/favorite-vacancy-45.blade.php index 7719459..1f30c48 100644 --- a/resources/views/js/favorite-vacancy-45.blade.php +++ b/resources/views/js/favorite-vacancy-45.blade.php @@ -1,6 +1,4 @@