* fix beginIF for dao.class.php and saveQueryCondition for doc.
This commit is contained in:
@@ -1897,6 +1897,8 @@ class baseSQL
|
||||
*/
|
||||
public function orderBy($order)
|
||||
{
|
||||
if($this->inCondition and !$this->conditionIsTrue) return $this;
|
||||
|
||||
$order = str_replace(array('|', '', '_'), ' ', $order);
|
||||
|
||||
/* Add "`" in order string. */
|
||||
@@ -1941,6 +1943,7 @@ class baseSQL
|
||||
*/
|
||||
public function limit($limit)
|
||||
{
|
||||
if($this->inCondition and !$this->conditionIsTrue) return $this;
|
||||
if(empty($limit)) return $this;
|
||||
stripos($limit, 'limit') !== false ? $this->sql .= " $limit " : $this->sql .= ' ' . DAO::LIMIT . " $limit ";
|
||||
return $this;
|
||||
@@ -1956,6 +1959,7 @@ class baseSQL
|
||||
*/
|
||||
public function groupBy($groupBy)
|
||||
{
|
||||
if($this->inCondition and !$this->conditionIsTrue) return $this;
|
||||
$this->sql .= ' ' . DAO::GROUPBY . " $groupBy";
|
||||
return $this;
|
||||
}
|
||||
@@ -1970,6 +1974,7 @@ class baseSQL
|
||||
*/
|
||||
public function having($having)
|
||||
{
|
||||
if($this->inCondition and !$this->conditionIsTrue) return $this;
|
||||
$this->sql .= ' ' . DAO::HAVING . " $having";
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -152,6 +152,7 @@ class docModel extends model
|
||||
$docs = $this->dao->select('*')->from(TABLE_DOC)->where($docQuery)->andWhere('deleted')->eq(0)->orderBy($sort)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'doc');
|
||||
if($docs) return $docs;
|
||||
|
||||
return array();
|
||||
|
||||
Reference in New Issue
Block a user