* Migrate changes from 18.x to master.

This commit is contained in:
朱金勇
2023-10-12 08:42:59 +00:00
parent 29015e48aa
commit 6948740e1d
21 changed files with 212 additions and 74 deletions
+12 -12
View File
@@ -178,7 +178,7 @@ class treeModel extends model
$treeMenu = array();
foreach($branches as $branchID => $branch)
{
$stmt = $this->dbh->query($this->buildMenuQuery($rootID, $type, $startModule, $branchID, $param));
$stmt = $this->app->dbQuery($this->buildMenuQuery($rootID, $type, $startModule, $branchID, $param));
$modules = array();
while($module = $stmt->fetch())
{
@@ -447,7 +447,7 @@ class treeModel extends model
if($type == 'case' and !empty($extra)) $this->loadModel('testtask');
$modules = array();
$stmt = $this->dbh->query($this->buildMenuQuery($rootID, $type, $startModule, $branch));
$stmt = $this->app->dbQuery($this->buildMenuQuery($rootID, $type, $startModule, $branch));
while($module = $stmt->fetch())
{
if($onlyGetLinked && !isset($executionModules[$module->id]) && empty($product->shadow)) continue;
@@ -522,7 +522,7 @@ class treeModel extends model
->andWhere('deleted')->eq(0)
->orderBy('grade desc, `order`, type')
->get();
$stmt = $this->dbh->query($query);
$stmt = $this->app->dbQuery($query);
while($module = $stmt->fetch())
{
if(!$manage and !isset($executionModules[$module->id]) and strpos($extra['extra'], 'allModule') === false) continue;
@@ -542,7 +542,7 @@ class treeModel extends model
->andWhere('deleted')->eq(0)
->orderBy('grade desc, `order`, type')
->get();
$stmt = $this->dbh->query($query);
$stmt = $this->app->dbQuery($query);
while($module = $stmt->fetch())
{
$module->url = helper::createLink('execution', 'task', "executionID={$rootID}&type=byModule&param={$module->id}");
@@ -570,7 +570,7 @@ class treeModel extends model
if(!$this->isMergeModule($rootID, 'task') or !$products)
{
$extra['tip'] = false;
$stmt = $this->dbh->query($this->buildMenuQuery($rootID, 'task', $startModule = 0));
$stmt = $this->app->dbQuery($this->buildMenuQuery($rootID, 'task', $startModule = 0));
if(empty($products)) $this->config->execution->task->allModule = 1;
return $this->getDataStructure($stmt, 'task', $rootID);
}
@@ -593,7 +593,7 @@ class treeModel extends model
->andWhere('deleted')->eq(0)
->orderBy('grade desc, `order`, type')
->get();
$stmt = $this->dbh->query($query);
$stmt = $this->app->dbQuery($query);
if($branch == 0) $productTree = $this->getDataStructure($stmt, 'task', $rootID, $executionModules);
if($branch != 0)
{
@@ -612,7 +612,7 @@ class treeModel extends model
->andWhere('deleted')->eq(0)
->orderBy('grade desc, `order`, type')
->get();
$stmt = $this->dbh->query($query);
$stmt = $this->app->dbQuery($query);
$taskTrees = $this->getDataStructure($stmt, 'task', $rootID, $executionModules);
foreach($taskTrees as $taskModule) $fullTrees[] = $taskModule;
return $fullTrees;
@@ -628,7 +628,7 @@ class treeModel extends model
*/
public function getTreeStructure($rootID, $type)
{
$stmt = $this->dbh->query($this->buildMenuQuery($rootID, $type, $startModule = 0));
$stmt = $this->app->dbQuery($this->buildMenuQuery($rootID, $type, $startModule = 0));
return $this->getDataStructure($stmt, $type, $rootID);
}
@@ -754,7 +754,7 @@ class treeModel extends model
->andWhere('deleted')->eq(0)
->orderBy('grade desc, `order`, type')
->get();
$stmt = $this->dbh->query($query);
$stmt = $this->app->dbQuery($query);
while($module = $stmt->fetch())
{
if(isset($executionModules[$module->id])) $modules[] = $this->buildTree($module, 'case', $data->id, $userFunc, $extra, $branch);
@@ -825,7 +825,7 @@ class treeModel extends model
->andWhere('deleted')->eq(0)
->orderBy('grade desc, branch, `order`, type')
->get();
$stmt = $this->dbh->query($query);
$stmt = $this->app->dbQuery($query);
while($module = $stmt->fetch())
{
/* If not manage, ignore unused modules. */
@@ -2253,7 +2253,7 @@ class treeModel extends model
public function getProductStructure($rootID, $viewType, $branchID = 'all', $currentModuleID = 0)
{
if($viewType == 'line') $rootID = 0;
$stmt = $this->dbh->query($this->buildMenuQuery($rootID, $viewType, $currentModuleID, $branchID));
$stmt = $this->app->dbQuery($this->buildMenuQuery($rootID, $viewType, $currentModuleID, $branchID));
$trees = $this->getDataStructure($stmt, $viewType, $rootID, array(), $branchID);
return $trees;
@@ -2329,7 +2329,7 @@ class treeModel extends model
*/
public function getDocStructure()
{
$stmt = $this->dbh->query($this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('doc')->andWhere('deleted')->eq(0)->orderBy('`grade`_desc, `order`')->get());
$stmt = $this->app->dbQuery($this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('doc')->andWhere('deleted')->eq(0)->orderBy('`grade`_desc, `order`')->get());
$parent = array();
while($module = $stmt->fetch())
{