CompanyContactsRepository.php 821 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Repositories;
  3. use App\Models\CompanyContact;
  4. use Prettus\Repository\Eloquent\BaseRepository;
  5. use Prettus\Repository\Criteria\RequestCriteria;
  6. use Illuminate\Support\Facades\DB;
  7. class CompanyContactsRepository extends BaseRepository
  8. {
  9. /**
  10. * Specify Model class name
  11. *
  12. * @return string
  13. */
  14. public function model()
  15. {
  16. return CompanyContact::class;
  17. }
  18. /**
  19. * Boot up the repository, pushing criteria
  20. */
  21. public function boot()
  22. {
  23. $this->pushCriteria(app(RequestCriteria::class));
  24. }
  25. //获取企业信息
  26. public function getContacts($where)
  27. {
  28. return $this->model->where($where)->get();
  29. }
  30. //获取一条信息
  31. public function getOne($id)
  32. {
  33. return $this->model->find($id);
  34. }
  35. }