diff --git a/module/action/model.php b/module/action/model.php index b2d40af67a..d54f772a6f 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1136,9 +1136,7 @@ class actionModel extends model ->beginIF($account != 'all')->andWhere('actor')->eq($account)->fi() ->beginIF($beginDate)->andWhere('date')->ge($beginDate)->fi() ->beginIF(is_numeric($productID))->andWhere('product')->like("%,$productID,%")->fi() - ->andWhere() - ->markLeft(1) - ->where('1=1') + ->andWhere('1=1', true) ->beginIF(is_numeric($projectID))->andWhere('project')->eq($projectID)->fi() ->beginIF(!empty($executions))->andWhere('execution')->in(array_keys($executions))->fi() ->beginIF(is_numeric($executionID))->andWhere('execution')->eq($executionID)->fi() diff --git a/module/admin/control.php b/module/admin/control.php index be3f68d288..be05d520ba 100755 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -478,7 +478,7 @@ class admin extends control $response['thisTable'] = ''; $response['nextTable'] = ''; - $tableEngines = $this->loadModel('misc')->getTableEngines(); + $tableEngines = $this->dao->getTableEngines(); $thisTable = ''; $nextTable = ''; diff --git a/module/convert/model.php b/module/convert/model.php index 45e48cc0ac..8eb185fec4 100644 --- a/module/convert/model.php +++ b/module/convert/model.php @@ -128,7 +128,7 @@ class convertModel extends model { $dataList = $this->dao->dbh($this->sourceDBH)->select('t1.`ID`, t1.`lower_user_name` as account, t1.`lower_display_name` as realname, t1.`lower_email_address` as email, t1.created_date as `join`, t2.user_key as userCode')->from(JIRA_USERINFO)->alias('t1') ->leftJoin(JIRA_USER)->alias('t2')->on('t1.`lower_user_name` = t2.`lower_user_name`') - ->where(1) + ->where('1=1') ->beginIF($lastID)->andWhere('t1.ID')->gt($lastID)->fi() ->orderBy('t1.ID asc')->limit($limit) ->fetchAll('ID'); @@ -136,7 +136,7 @@ class convertModel extends model elseif($module == 'project') { $dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_PROJECT) - ->where(1) + ->where('1=1') ->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi() ->orderBy('ID asc')->limit($limit) ->fetchAll('ID'); @@ -144,7 +144,7 @@ class convertModel extends model elseif($module == 'issue') { $dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_ISSUE) - ->where(1) + ->where('1=1') ->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi() ->orderBy('ID asc')->limit($limit) ->fetchAll('ID'); @@ -152,7 +152,7 @@ class convertModel extends model elseif($module == 'build') { $dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_BUILD) - ->where(1) + ->where('1=1') ->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi() ->orderBy('ID asc')->limit($limit) ->fetchAll('ID'); @@ -160,7 +160,7 @@ class convertModel extends model elseif($module == 'issuelink') { $dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_ISSUELINK) - ->where(1) + ->where('1=1') ->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi() ->orderBy('ID asc')->limit($limit) ->fetchAll('ID'); @@ -168,7 +168,7 @@ class convertModel extends model elseif($module == 'action') { $dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_ACTION) - ->where(1) + ->where('1=1') ->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi() ->orderBy('ID asc')->limit($limit) ->fetchAll('ID'); @@ -176,7 +176,7 @@ class convertModel extends model elseif($module == 'file') { $dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_FILE) - ->where(1) + ->where('1=1') ->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi() ->orderBy('ID asc')->limit($limit) ->fetchAll('ID'); diff --git a/module/doc/model.php b/module/doc/model.php index 4ed5ee207b..95d3d5f976 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1218,7 +1218,7 @@ class docModel extends model if($libID == 0 and $browseType != 'collectedbyme') return array(); $modules = $this->dao->select('*')->from(TABLE_MODULE) - ->where(1) + ->where('1=1') ->beginIF($browseType != "collectedbyme")->andWhere('root')->eq($libID)->fi() ->beginIF($browseType == "collectedbyme")->andWhere('collector')->like("%,{$this->app->user->account},%")->fi() ->andWhere('type')->eq('doc') diff --git a/module/kanban/model.php b/module/kanban/model.php index e5ae52bd69..57c4976279 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3705,7 +3705,7 @@ class kanbanModel extends model public function getColumnsByObject($objectType = '', $objectID = 0, $archived = 0, $deleted = '0') { return $this->dao->select('*')->from(TABLE_KANBANCOLUMN) - ->where(true) + ->where('1=1') ->beginIF($objectType)->andWhere($objectType)->eq($objectID)->fi() ->beginIF($archived != '')->andWhere('archived')->eq($archived)->fi() ->beginIF($deleted != '')->andWhere('deleted')->eq($deleted)->fi() @@ -3817,7 +3817,7 @@ class kanbanModel extends model public function getCardsByObject($objectType = '', $objectID = 0, $archived = '0', $deleted = '0') { return $this->dao->select('*')->from(TABLE_KANBANCARD) - ->where(true) + ->where('1=1') ->beginIF($objectType)->andWhere($objectType)->eq($objectID)->fi() ->beginIF($archived != '')->andWhere('archived')->eq($archived)->fi() ->beginIF($deleted != '')->andWhere('deleted')->eq($deleted)->fi() diff --git a/module/product/model.php b/module/product/model.php index b34abb85fb..aa49c1c194 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -370,7 +370,7 @@ class productModel extends model /* Order by program. */ return $this->dao->select("t1.*, IF(INSTR(' closed', t1.status) < 2, 0, 1) AS isClosed")->from(TABLE_PRODUCT)->alias('t1') ->leftJoin(TABLE_PROGRAM)->alias('t2')->on('t1.program = t2.id') - ->where(1) + ->where('1=1') ->beginIF(strpos($mode, 'all') === false)->andWhere('t1.deleted')->eq(0)->fi() ->beginIF($programID)->andWhere('t1.program')->eq($programID)->fi() ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('t1.status')->ne('closed')->fi() diff --git a/module/search/model.php b/module/search/model.php index 4ecf897ed2..82e4b2d8fa 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -463,12 +463,10 @@ class searchModel extends model { $queries = $this->dao->select('id, title') ->from(TABLE_USERQUERY) - ->where() - ->markLeft(1) - ->where('account')->eq($this->app->user->account) + ->where('module')->eq($module) + ->andWhere('account', true)->eq($this->app->user->account) ->orWhere('common')->eq(1) ->markRight(1) - ->andWhere('module')->eq($module) ->orderBy('id_desc') ->fetchPairs(); if(!$queries) return array('' => $this->lang->search->myQuery); @@ -487,12 +485,10 @@ class searchModel extends model { $queries = $this->dao->select('id, account, title') ->from(TABLE_USERQUERY) - ->where() - ->markLeft(1) - ->where('account')->eq($this->app->user->account) + ->where('module')->eq($module) + ->andWhere('account', true)->eq($this->app->user->account) ->orWhere('common')->eq(1) ->markRight(1) - ->andWhere('module')->eq($module) ->orderBy('id_desc') ->fetchAll(); if(!$queries) return array('' => $this->lang->search->myQuery); diff --git a/module/user/model.php b/module/user/model.php index 1c80f50a72..8c08c0b141 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -41,7 +41,7 @@ class userModel extends model public function getList($params = 'nodeleted') { return $this->dao->select('*')->from(TABLE_USER) - ->where(true) + ->where('1=1') ->beginIF(strpos($params, 'all') === false)->andWhere('type')->eq('inside')->fi() ->beginIF(strpos($params, 'nodeleted') !== false)->andWhere('deleted')->eq(0)->fi() ->orderBy('account')