RecruitService.php 646 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Services\Recruit;
  3. use App\Repositories\Recruit\RecruitRepository;
  4. class RecruitService
  5. {
  6. protected $recruitRepository;
  7. public function __construct(RecruitRepository $recruitRepository)
  8. {
  9. $this->recruitRepository = $recruitRepository;
  10. }
  11. public function getRecruit($key = '', $page = '')
  12. {
  13. //搜索条件
  14. $where = [];
  15. $where[] = ['status', '=', '1'];
  16. if ($key) {
  17. $where[] = ['name', 'like', '%' . $key . '%'];
  18. }
  19. //获取列表
  20. $list = $this->recruitRepository->getRecuit($where, $page);
  21. return $list;
  22. }
  23. }