* fix bug for search in build.
This commit is contained in:
+13
-3
@@ -84,15 +84,25 @@ class buildModel extends model
|
||||
public function getProjectBuildsBySearch($projectID, $queryID)
|
||||
{
|
||||
/* If there are saved query conditions, reset the session. */
|
||||
if($queryID)
|
||||
if((int)$queryID)
|
||||
{
|
||||
$query = $this->loadModel('search')->getQuery($queryID);
|
||||
if($query)
|
||||
$buildQuery = $this->loadModel('search')->getQuery($queryID);
|
||||
if($buildQuery)
|
||||
{
|
||||
$this->session->set('projectBuildQuery', $query->sql);
|
||||
$this->session->set('projectBuildForm', $query->form);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('projectBuildQuery', ' 1 = 1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->session->projectBuildQuery == false) $this->session->set('projectBuildQuery', ' 1 = 1');
|
||||
}
|
||||
|
||||
$buildQuery = $this->session->projectBuildQuery;
|
||||
|
||||
/* Distinguish between repeated fields. */
|
||||
$fields = array('id' => '`id`', 'name' => '`name`', 'product' => '`product`', 'desc' => '`desc`');
|
||||
|
||||
@@ -885,7 +885,7 @@ class project extends control
|
||||
/* Get builds. */
|
||||
if($type == 'bysearch')
|
||||
{
|
||||
$builds = $this->loadModel('build')->getProjectBuildsBySearch((int)$projectID, $param);
|
||||
$builds = $this->loadModel('build')->getProjectBuildsBySearch((int)$projectID, (int)$param);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user