Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function search()
- {
- $ramais = $this->paginate($this->Ramais);
- if ($this->request->is('post')) {
- $search = null;
- if (isset($this->request->data['search'])) {
- $search = $this->request->data['search'];
- }
- $ramal = $this->Ramais->find('all',
- [
- 'contain' => ['Setores'],
- 'conditions'=>['OR'=>
- [
- 'Ramais.name LIKE'=>'%'.$search.'%',
- 'Ramais.ramal LIKE'=>'%'.$search.'%',
- 'Setores.name LIKE'=>'%'.$search.'%'
- ]
- ]
- ]
- );
- //debug($ramal); exit();
- $this->set(compact('ramais', 'ramal', 'setor'));
- $this->set('_serialize', ['ramais'], ['setor']);
- $this->render('index');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement