ServiceRepository.php 682 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Repositories;
  3. use Prettus\Repository\Eloquent\BaseRepository;
  4. use App\Models\Service;
  5. class ServiceRepository extends BaseRepository
  6. {
  7. public function model()
  8. {
  9. return Service::class;
  10. }
  11. public function list($page, $where)
  12. {
  13. return $this->model->where($where)->orderByRaw('id desc')->paginate($page, ['*']);
  14. }
  15. public function total($where)
  16. {
  17. return $this->model->where($where)->count();
  18. }
  19. public function delService($where){
  20. return $this->model->where($where)->delete();
  21. }
  22. public function getService($where)
  23. {
  24. return $this->model->where($where)->first();
  25. }
  26. }