*Optimize the code.

This commit is contained in:
孙华伟
2022-05-11 16:25:43 +08:00
parent ffed15713b
commit 0aa36bd6e5
4 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -637,10 +637,9 @@ class projectModel extends model
* */
public function getBySearch($projectQuery)
{
$flag = stripos($projectQuery, 'and') + 3;
$projectQuery = substr_replace($projectQuery, " (`type` = 'project') and", $flag, 0);
$projects = $this->dao->select('*')->from(TABLE_PROJECT)
->where($projectQuery)
->andWhere('type')->eq('project')
->fetchAll();
return $projects;
}