Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

44 lines
952B

  1. <?php
  2. namespace App\Models;
  3. use CodeIgniter\Model;
  4. class PrestadorModel extends Model
  5. {
  6. protected $table = 'prestador';
  7. protected $primaryKey = 'idprestador';
  8. protected $useTimestamps = false;
  9. protected $allowedFields = [
  10. 'nombre', 'apaterno', 'amaterno', 'fechanac',
  11. 'direccion', 'colonia', 'municipio', 'cp',
  12. 'telefono', 'celular', 'email',
  13. 'idescuela', 'carrera', 'grado', 'turno',
  14. 'tipo', 'fechainicio', 'iddepartamento_actual', 'horas_servicio',
  15. ];
  16. // GUARDAR COMO NOMBRE
  17. // turno, tipo
  18. function getPrestador($id = null)
  19. {
  20. return $this->where('idprestador', $id)->first();
  21. }
  22. public function getPrestadoresActivos()
  23. {
  24. return $this
  25. ->where('status', 0)
  26. ->findAll();
  27. }
  28. function countPrestadoresActivos()
  29. {
  30. return $this
  31. ->where('status', 0)
  32. ->countAllResults();
  33. }
  34. }