Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 2090 | Rev 2380 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2090 Rev 2093
Línea 210... Línea 210...
210
        $delete->where->equalTo('id', $id);
210
        $delete->where->equalTo('id', $id);
Línea 211... Línea 211...
211
        
211
        
212
        return $this->executeDelete($delete);
212
        return $this->executeDelete($delete);
Línea 213... Línea -...
213
    }
-
 
214
    
-
 
215
    public function fetchAllSuggestForInvitationByHptgId($group_id, $company_id, $search)
-
 
216
    {
-
 
217
        $selectGroupMembers = $this->sql->select(HighPerformanceTeamsGroupsMembersMapper::_TABLE);
-
 
218
        $selectGroupMembers->columns(['user_id']);
-
 
219
        $selectGroupMembers->where->equalTo('group_id', $group_id);
-
 
220
        $selectGroupMembers->where->in('status', [
-
 
221
            HighPerformanceTeamsGroupsMembers::STATUS_ACCEPTED,
-
 
222
            HighPerformanceTeamsGroupsMembers::STATUS_ADDED_BY_ADMIN,
-
 
223
            HighPerformanceTeamsGroupsMembers::STATUS_INVITED,
-
 
224
        ]);
-
 
225
        
213
    }
226
        //echo $selectGroupMembers->getSqlString($this->adapter->platform); exit;
-
 
227
        
-
 
228
        $select = $this->sql->select();
-
 
229
        $select->from(self::_TABLE);
-
 
230
        $select->where->notIn('user_id', $selectGroupMembers);
-
 
231
        $select->where->equalTo('company_id', $company_id);
-
 
232
        
-
 
233
        if($search) {
-
 
234
            $select->where->nest()
-
 
235
            ->like('first_name', '%' . $search . '%')
-
 
236
            ->or->like('last_name', '%' . $search . '%')
-
 
237
            ->or->like('email', '%' . $search . '%')
-
 
238
            ->unnest();
-
 
239
            
-
 
240
        }
-
 
241
        
-
 
242
        $select->order(['first_name', 'last_name']);
-
 
243
        
-
 
244
        // echo $select->getSqlString($this->adapter->platform); exit;
-
 
245
        
-
 
246
        $prototype = new CompanyUser();
-
 
247
        
-
 
Línea 248... Línea 214...
248
        return $this->executeFetchAllObject($select, $prototype);
214
    
249
    }
215