* Optimize code.

This commit is contained in:
mayue
2022-08-23 09:33:45 +08:00
parent b9ac60f75f
commit 2f2f0e6542
2 changed files with 5 additions and 9 deletions
+4 -2
View File
@@ -60,18 +60,20 @@ class docModel extends model
* @param string $type
* @param string $extra
* @param string $appendLibs
* @param int $projectID
* @param int $objectID
* @param string $exclude
*
* @access public
* @return array
*/
public function getLibs($type = '', $extra = '', $appendLibs = '', $objectID = 0)
public function getLibs($type = '', $extra = '', $appendLibs = '', $objectID = 0, $exclude = '')
{
if($type == 'all' or $type == 'includeDeleted')
{
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)
->where('type')->ne('api')
->beginIF($type == 'all')->andWhere('deleted')->eq(0)->fi()
->beginIF($exclude)->andWhere('type')->notin($exclude)->fi()
->andWhere('vision')->eq($this->config->vision)
->orderBy('`order` asc, id_desc')
->query();