* [story #67973, doing] return projects and independent api libs in model method 'getGroupedObjects'.
This commit is contained in:
+21
-1
@@ -924,7 +924,27 @@ class apiModel extends model
|
||||
->orderBy('order_asc')
|
||||
->fetchAll('id');
|
||||
|
||||
return array('product' => $products);
|
||||
/* 获取接口库所属项目的项目列表。 */
|
||||
$projects = $this->dao->select('t1.id, t1.order, t1.name, t1.status, t1.parent')->from(TABLE_PROJECT)->alias('t1')
|
||||
->leftJoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id')
|
||||
->where('t2.id')->gt(0)
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
|
||||
->andWhere('t2.id')->in($libIDs)
|
||||
->orderBy('t1.hasProduct_asc, order_asc')
|
||||
->fetchAll('id');
|
||||
|
||||
$nolinks = array();
|
||||
foreach($libs as $lib)
|
||||
{
|
||||
if($lib->product != 0 && isset($products[$lib->product]) && !isset($products[$lib->product]->firstLib)) $products[$lib->product]->firstLib = $lib->id;
|
||||
if($lib->project != 0 && isset($projects[$lib->project]) && !isset($projects[$lib->project]->firstLib)) $projects[$lib->project]->firstLib = $lib->id;
|
||||
if($lib->product != 0 || $lib->project != 0 || $lib->execution != 0) continue;
|
||||
$nolinks[$lib->id] = $lib;
|
||||
}
|
||||
|
||||
return array('product' => $products, 'project' => $projects, 'nolink' => $nolinks);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user