Skip to content

Commit

Permalink
Small bugfix
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11516 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Nov 27, 2011
1 parent 3e0158c commit f5c054d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions application/models/survey_permissions_model.php
Expand Up @@ -72,35 +72,35 @@ function insertSomeRecords($data)
{
$this->db->insert('survey_permissions', $data);
}

function specificQuery($surveyid, $postusergroupid)
{
//Create sub-query
//Create sub-query
$this->db->select('uid');
$this->db->from('survey_permissions');
$this->db->where('sid' => $surveyid);
$this->db->where(array('sid' => $surveyid));

$subQuery = $this->db->get_compile_select();
$this->db->_reset_select();

// Main query
$this->db->select('b.id');
$thid->db->from('('.$subQuery.') AS c');
$this->db->join('user_in_groups AS b', 'b.uid = c.uid', 'right');
$this->db->where('c.uid' => NULL);
$this->db->where('b.ugid' => $postusergroupid);
$this->db->where(array('c.uid' => NULL));
$this->db->where(array('b.ugid' => $postusergroupid));
return $this->db->get();
}

function joinQuery($what, $from, $where = array(), $join = array(), $order = NULL, $group = NULL)
{
$this->db->select($what);
$this->db->from($from);
$this->db->where($where);

if (isset($join['table'], $join['on'], $join['type']))
$this->db->join($join['table'], $join['on'], $join['type']);

if ( ! empty($order)) $this->db->order_by($order);
if ( ! empty($group)) $this->db->group_by($group);
return $this->db->get();
Expand Down

0 comments on commit f5c054d

Please sign in to comment.