Wachter callback snellere queryfilter lege records
This commit is contained in:
@@ -89,15 +89,34 @@ class Users_model extends MY_Model{
|
||||
ORDER BY U.achternaam";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
function otherusers($orgid, $orgids){
|
||||
$this->sql="SELECT DISTINCT(U.id), concat_ws(' ',voornaam, tussenvoegsel, achternaam) AS fullname
|
||||
FROM tb_users U
|
||||
JOIN tb_orgusers OU ON OU.user_id= U.id
|
||||
WHERE (SELECT count(id) FROM tb_orgusers WHERE user_id = U.id AND organisatie_id = {$orgid}) = 0
|
||||
AND (OU.organisatie_id IN ({$orgids}) )
|
||||
ORDER BY achternaam";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
// function otherusers($orgid, $orgids){
|
||||
// $this->sql="SELECT DISTINCT(U.id), concat_ws(' ',voornaam, tussenvoegsel, achternaam) AS fullname
|
||||
// FROM tb_users U
|
||||
// JOIN tb_orgusers OU ON OU.user_id= U.id
|
||||
// WHERE (SELECT count(id) FROM tb_orgusers WHERE user_id = U.id AND organisatie_id = {$orgid})
|
||||
// AND (OU.organisatie_id IN ({$orgids}) )
|
||||
// ORDER BY achternaam";
|
||||
// return $this->get_query_result();
|
||||
// }
|
||||
function otherusers($orgid, $orgids){
|
||||
$this->sql="SELECT DISTINCT(U.id), concat_ws(' ',voornaam, tussenvoegsel, achternaam) AS fullname
|
||||
FROM tb_users U
|
||||
JOIN tb_orgusers OU ON OU.user_id= U.id
|
||||
WHERE OU.organisatie_id IN ({$orgids})
|
||||
AND U.actief = 1
|
||||
AND U.voornaam <> ''
|
||||
AND U.achternaam <> ''
|
||||
AND OU.user_id NOT IN (
|
||||
SELECT OU2.user_id
|
||||
FROM tb_orgusers OU2
|
||||
WHERE OU2.organisatie_id = {$orgid}
|
||||
)
|
||||
GROUP BY U.id
|
||||
ORDER BY achternaam ";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
|
||||
function get_users_by_organisatie($orgid){
|
||||
// uit partituur users
|
||||
$this->sql = "SELECT U.id, U.gnaam as user_name, concat_ws(' ', voornaam, tussenvoegsel, achternaam) as fullname
|
||||
|
||||
Reference in New Issue
Block a user