CompanyInterviewController.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. namespace App\Http\Controllers\Jkq\Company;
  3. use App\Http\Controllers\Jkq\JkqBaseController;
  4. use App\Services\Company\CompanyInterviewService;
  5. use App\Services\Person\ResumeService;
  6. use App\Services\Recuperate\RecuperateApplyService;
  7. use Illuminate\Http\Request;
  8. class CompanyInterviewController extends JkqBaseController
  9. {
  10. /**
  11. * @var CompanyInterviewService
  12. */
  13. protected $CompanyInterviewService;
  14. protected $ResumeService;
  15. protected $recuperateApplyService;
  16. /**
  17. * CompanyInterviewController constructor.
  18. * @param CompanyInterviewService $CompanyInterviewService
  19. * @param ResumeService $ResumeService
  20. * @param RecuperateApplyService $recuperateApplyService
  21. */
  22. public function __construct(CompanyInterviewService $CompanyInterviewService, ResumeService $ResumeService,RecuperateApplyService $recuperateApplyService)
  23. {
  24. $this->CompanyInterviewService = $CompanyInterviewService;
  25. $this->ResumeService = $ResumeService;
  26. $this->recuperateApplyService = $recuperateApplyService;
  27. }
  28. public function jobsInterview(Request $request)
  29. {
  30. $resume = $this->ResumeService->myResumeAjax(auth('web-member')->user());
  31. $interview = $this->CompanyInterviewService->getInterviewByUid(auth('web-member')->user(), $request->all());
  32. return view('jkq.person.jobs_interview',
  33. ['resume'=>$resume,'interview'=>$interview['interview'],'count'=>$interview['count']]);
  34. }
  35. public function setInterview(Request $request)
  36. {
  37. $res = $this->CompanyInterviewService->setInterview($request->id,auth('web-member')->user());
  38. if ($res) {
  39. return $this->sendSuccessResponse('设置成功');
  40. } else {
  41. return $this->sendErrorResponse('设置失败');
  42. }
  43. }
  44. public function delInterview(Request $request)
  45. {
  46. if (request()->method()=='POST') {
  47. $res = $this->CompanyInterviewService->delInterview($request->id,auth('web-member')->user());
  48. if ($res) {
  49. return $this->sendSuccessResponse('删除成功');
  50. } else {
  51. return $this->sendErrorResponse('删除失败');
  52. }
  53. } else {
  54. return view('jkq.person.ajax.resume_delete', ['tpis'=>'删除后将无法恢复,您确定要删除选中的面试邀请吗?']);
  55. }
  56. }
  57. public function ajaxInterviewDetail()
  58. {
  59. $res = $this->CompanyInterviewService->ajaxInterviewDetail(request()->id,auth('web-member')->user());
  60. $html = view('jkq.person.ajax.show_interview', ['content'=>$res])->render();
  61. return $this->sendSuccessResponse($html);
  62. }
  63. /**
  64. * 疗养套餐报名列表
  65. */
  66. public function recuperate(Request $request)
  67. {
  68. $res = $this->recuperateApplyService->list($request->input('status',null), 6, ['recuperate']);
  69. $params = $request->all();
  70. $params['status'] = $params['status'] ?? null;
  71. $return_data = [
  72. 'list' => $res,
  73. 'params' => $params,
  74. ];
  75. return view('jkq.person.recuperate', $return_data);
  76. }
  77. }