Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $parkingSpacesOficina = $this->find('all', array(
- 'fields' => array ($this->alias.'.id', $this->alias.'.name'),
- 'conditions' => array(
- 'OPS.office_id' => 1,
- 'U.id' => $idUser,
- $this->alias.'.type' => VISITOR,
- $this->alias.'.taken' => false
- ),
- 'joins' => array(
- array(
- 'table' => 'offices_parking_spaces',
- 'alias' => 'OPS',
- 'conditions' => 'OPS.parking_spaces_id = ParkingSpace.id',
- 'type' => 'INNER'
- ),
- array(
- 'table' => 'users',
- 'alias' => 'U',
- 'conditions' => 'OPS.office_id = U.office_id',
- 'type' => 'INNER'
- )
- )
- ));
- $parkingSpacesReservadosVisitantesEnHorario = $this->find('all', array(
- 'fields' => array ($this->alias.'.id', $this->alias.'.name', 'R.license_plate_number', 'R.reserved_date_start', 'R.reserved_date_end', 'V.name', 'V.last_name'),
- 'conditions' => array(
- '? BETWEEN R.reserved_date_start and R.reserved_date_end' => array($startDate),
- '? BETWEEN R.reserved_date_start and R.reserved_date_end' => array($endDate),
- $this->alias.'.type' => VISITOR,
- $this->alias.'.taken' => false
- ),
- 'joins' => array(
- array(
- 'table' => 'reservations',
- 'alias' => 'R',
- 'conditions' => 'R.parking_spaces_id = ParkingSpace.id',
- 'type' => 'INNER'
- ),
- array(
- 'table' => 'visitors',
- 'alias' => 'V',
- 'conditions' => 'R.visitor_id = V.id',
- 'type' => 'INNER'
- )
- )
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement