Updating public profile by writing new code that reduces queries and adds some more features - also fixes issue 13

This commit is contained in:
Nathan Adams
2013-08-17 14:32:11 -05:00
parent ccece87dee
commit 18e191abc0
5 changed files with 136 additions and 60 deletions

View File

@@ -35,6 +35,7 @@ class IDF_Issue extends Pluf_Model
function init()
{
//$tagtbl = "indefero_idf_tags";
$this->_a['table'] = 'idf_issues';
$this->_a['model'] = __CLASS__;
$this->_a['cols'] = array(
@@ -119,7 +120,18 @@ class IDF_Issue extends Pluf_Model
),
);
$table = $this->_con->pfx.'idf_issue_idf_tag_assoc';
$tagtbl = $this->_con->pfx . "idf_tags";
$projtbl = $this->_con->pfx . "idf_projects";
$this->_a['views'] = array(
'project_find' => array (
'where' => '( lcname = "new" or lcname = "accepted" or lcname = "started" )',
'join' => "INNER JOIN " . $tagtbl . " on " . $this->getSqlTable() . ".status = " . $tagtbl . ".id"
),
'project_find_private' => array (
'where' => 'private = 0 AND ( lcname = "new" or lcname = "accepted" or lcname = "started" )',
'join' => "INNER JOIN " . $tagtbl . " on " . $this->getSqlTable() . ".status = " . $tagtbl . ".id INNER JOIN " . $projtbl . " ON " . $this->getSqlTable() . ".project = " . $projtbl . ".id"
),
'join_tags' =>
array(
'join' => 'LEFT JOIN '.$table