QrcodeController.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. namespace App\Http\Controllers\Mobile;
  3. use App\Services\Content\LinkService;
  4. use App\Services\HomeService;
  5. use App\Services\Company\JobsService;
  6. use App\Services\Common\CategoryService;
  7. use App\Services\Company\CompanyDownResumeService;
  8. use App\Services\Common\SearchService;
  9. use App\Services\Person\ResumeService;
  10. use App\Services\Company\CompanyService;
  11. use App\Services\Jobfair\JobfairService;
  12. use App\Services\Content\NoticeServer;
  13. use App\Services\Content\ArticleService;
  14. use App\Services\Common\HotWordService;
  15. class QrcodeController extends MobileBaseController
  16. {
  17. protected $companyService;
  18. protected $jobsService;
  19. protected $resumeService;
  20. public function __construct(JobsService $jobsService, CompanyService $companyService, ResumeService $resumeService)
  21. {
  22. $this->jobsService = $jobsService;
  23. $this->companyService = $companyService;
  24. $this->resumeService = $resumeService;
  25. }
  26. public function show($hashid)
  27. {
  28. $data = hashid_decode($hashid);
  29. $user_type = $data['utype'];
  30. $user_id = $data['id'];
  31. if ($user_type == 1) {
  32. //显示企业详细页面
  33. $company_id = $user_id;
  34. try {
  35. $company_info = $this->companyService->getCompanyInfo(array(array('id', '=', $company_id)));
  36. } catch (\Exception $e) {
  37. $back_url = \Illuminate\Support\Facades\URL::previous();
  38. return $this->showMessage('企业不存在', $back_url, true, '上一页', '3');
  39. }
  40. $this->putSeoData('company', $company_info);
  41. //在招职位
  42. $jobs_where = array(
  43. array('company_id','=',$company_info->id),
  44. array('valid','=',1),
  45. array('display','=',1)
  46. );
  47. $jobs_display = config('aix.companyset.comset.show_set.jobs_display');
  48. if ($jobs_display == 1) {
  49. $jobs_where[] = array('audit','=','1');
  50. } else {
  51. $jobs_where[] = array('audit','<>','3');
  52. }
  53. $jobs = $this->jobsService->getOtherJobs($jobs_where);
  54. $company_where = array(
  55. 'trade' => $company_info->trade,
  56. 'except_id' =>$company_info->id
  57. );
  58. $return_data = array(
  59. 'info'=>$company_info,
  60. 'jobs'=>$jobs,
  61. 'user'=> $company_info,
  62. ''
  63. );
  64. return view('mobile.app.content.jobs.comshow', $return_data);
  65. } else {
  66. //显示个人用户默认简历预览页面
  67. $person_info = $this->resumeService->getPersonInfo($user_id);
  68. if ($person_info && array_has($person_info, 'status') && $person_info['status']==0) {
  69. $back_url = \Illuminate\Support\Facades\URL::previous();
  70. return $this->showMessage($person_info['error'], $back_url, true, '上一页', '3');
  71. }
  72. $user = $person_info['user'];
  73. $del_resume = $person_info['resume'];
  74. $res = $this->resumeService->resumeShow($del_resume->id, '', $user, 'qr');
  75. if (array_has($res, 'status') && $res['status']==0) {
  76. $back_url = \Illuminate\Support\Facades\URL::previous();
  77. return $this->showMessage($res['msg'], $back_url, true, '上一页', '3');
  78. }
  79. $this->putSeoData('resume', $res['resume']);
  80. return view('mobile.app.content.resume.show', ['content'=>$res,'resume'=>$res['resume'],'user'=> $user]);
  81. }
  82. }
  83. }