Файловый менеджер - Редактировать - /home/clickysoft/public_html/benchexc.clickysoft.net/app/Repositories/SearchRepository.php
Назад
<?php namespace App\Repositories; use App\Interfaces\SearchRepositoryInterface; use App\Models\NeededTalent; use App\Models\NeededTalentTeckStack; use App\Models\opportunity; use App\Models\resource; use App\Models\TechStack; use http\Env\Request; class SearchRepository implements SearchRepositoryInterface { public function tackStackSearch($request) { $query = $request->input('query'); if (!$query) { return response()->json([]); } $techStacks = TechStack::where('Skills', 'LIKE', '%' . $query . '%') ->orWhere('technologies', 'LIKE', '%' . $query . '%') ->with(['resources', 'opportunities','neededTalent']) ->get(); return response()->json($techStacks); } public function searchFilter($request) { $min_experience = $request->input('min_experience'); $max_experience = $request->input('max_experience'); $cities = $request->input('city'); $onsite_availability = $request->input('onsite_availability'); $monthly_rate = $request->input('rate'); $day = $request->input('day'); $week = $request->input('week'); $month = $request->input('month'); // dd($request->all()); $conversion_factor = 160; $hourly_rate = $monthly_rate / $conversion_factor; $neededTalent = NeededTalent::where(function ($query) use ($monthly_rate, $hourly_rate) { $query->where('rate', 'LIKE', '%' . $monthly_rate . '%') ->orWhere('rate', 'LIKE', '%' . $hourly_rate . '%'); }) ->whereBetween('years_of_experience', [$min_experience,$max_experience]) ->whereIn('city_id', $cities) ->where('onsite_availability', 'LIKE', '%' . $onsite_availability . '%') // ->where('day','LIKE' , '%' . $day . '%') // ->where('week','LIKE' , '%' . $week . '%') // ->where('month','LIKE' , '%' . $month . '%') ->get(); $resources = resource::where(function ($query) use ($monthly_rate, $hourly_rate) { $query->where('rate', 'LIKE', '%' . $monthly_rate . '%') ->orWhere('rate', 'LIKE', '%' . $hourly_rate . '%'); }) ->whereBetween('years_of_experience', [$min_experience,$max_experience]) ->whereIn('city_id', $cities) ->where('onsite_availability', 'LIKE', '%' . $onsite_availability . '%') // ->where('day','LIKE' , '%' . $day . '%') // ->where('week','LIKE' , '%' . $week . '%') // ->where('month','LIKE' , '%' . $month . '%') ->get(); return response()->json([ 'needed_talent' => $neededTalent, 'resource' => $resources ]); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка