Beispiel #1
0
 public function getUserBookMarkedJobMatch(UserService $user, CompanyService $company, $user_id)
 {
     try {
         Session::put('user_id', $user_id);
         $user_skills = $user->getAllUserSkills($user_id);
         $skill_ids = [];
         $job_ids = [];
         $job_posts = [];
         foreach ($user_skills as $skill_info) {
             $skill_ids[] = $skill_info['skill_id'];
         }
         if (count($skill_ids) > 0) {
             $bookmark_job_ids = $user->getbookMarkedJobs($user_id);
             $job_ids = $company->getBookmarkedJobPostBySkills($skill_ids, $bookmark_job_ids);
             if (count($job_ids) > 0) {
                 $job_posts = $company->getCompanyJobPostByJobId($job_ids);
             }
         }
         Session::forget('user_id');
         return $this->json_response->success($job_posts);
     } catch (Exception $e) {
         return $this->json_response->error(['error' => $e->getMessage()]);
     }
 }