JobfairService.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace App\Services\Statistics;
  3. use App\Repositories\Jobfair\JobfairRepository;
  4. use App\Repositories\Jobfair\JobfairCompanyRepository;
  5. use App\Repositories\Jobfair\JobfairPutJobRepository;
  6. use App\Repositories\Jobfair\JobfairPersonSignedRepository;
  7. class JobfairService
  8. {
  9. protected $jobfairRepository;
  10. protected $jobfairCompanyRepository;
  11. protected $jobfairPutJobRepository;
  12. protected $jobfairPersonSignedRepository;
  13. /**
  14. * JobfairService constructor.
  15. */
  16. public function __construct(JobfairRepository $jobfairRepository,JobfairCompanyRepository $jobfairCompanyRepository, JobfairPutJobRepository $jobfairPutJobRepository, JobfairPersonSignedRepository $jobfairPersonSignedRepository)
  17. {
  18. $this->jobfairRepository = $jobfairRepository;
  19. $this->jobfairCompanyRepository = $jobfairCompanyRepository;
  20. $this->jobfairPutJobRepository = $jobfairPutJobRepository;
  21. $this->jobfairPersonSignedRepository = $jobfairPersonSignedRepository;
  22. }
  23. public function getJobfairNum($where)
  24. {
  25. return $this->jobfairRepository->getJobfairNum($where);
  26. }
  27. public function getJobfairVisitorNum($where = [])
  28. {
  29. return $this->jobfairPersonSignedRepository->getJobfairVisitorNum($where);
  30. }
  31. public function getJobfairIds($where)
  32. {
  33. $rst = $this->jobfairRepository->getStatisticsJobfairs($where);
  34. return $rst->pluck('id')->toArray();
  35. }
  36. public function getCompanyCount($where, $whereIn)
  37. {
  38. return $this->jobfairCompanyRepository->getStatisticsCompanyCount($where, $whereIn);
  39. }
  40. public function getJobsCount($where, $whereIn)
  41. {
  42. return $this->jobfairPutJobRepository->getStatisticsJobCount($where, $whereIn);
  43. }
  44. public function getJobsAmount($where, $whereIn)
  45. {
  46. return $this->jobfairPutJobRepository->getStatisticsJobAmount($where, $whereIn);
  47. }
  48. public function getPersonNums($where, $whereIn, $groupBy)
  49. {
  50. return $this->jobfairPersonSignedRepository->getStatisticsPersonList($where, $whereIn, $groupBy);
  51. }
  52. public function getSignPersonEducations($type, $where, $whereIn, $groupBy, $fields)
  53. {
  54. return $this->jobfairPersonSignedRepository->getStatisticsPersonEducations($type, $where, $whereIn, $groupBy, $fields);
  55. }
  56. }