* treeModel: use uniqid() instead of the global variable moduleID.

This commit is contained in:
liugang
2023-06-05 17:48:08 +08:00
parent 252acbe4a4
commit 8dfe0cc120
+3 -11
View File
@@ -11,14 +11,6 @@
*/
class treeModel extends model
{
/**
* The global moduleID.
*
* @var int
* @access private
*/
private $moduleID = 0;
/**
* Get module by ID.
*
@@ -755,7 +747,7 @@ class treeModel extends model
$extra['productID'] = $productID;
$data = new stdclass();
$data->id = ++$this->moduleID;
$data->id = uniqid();
$data->parent = 0;
$data->name = is_object($product) ? $product->name : $product;
$data->url = helper::createLink($moduleName, $methodName, $param . "productID=$productID");
@@ -1232,8 +1224,8 @@ class treeModel extends model
$param = $this->app->tab == 'execution' ? "executionID={$extra['projectID']}&" : $param;
$data = new stdclass();
$data->id = $parent ? ++$this->moduleID : $module->id;
$data->parent = $parent ? $parent: $module->parent;
$data->id = $parent ? uniqid() : $module->id;
$data->parent = $parent ? $parent : $module->parent;
$data->name = $module->name;
$data->url = helper::createLink($moduleName, $methodName, $param . "productID={$module->root}&branch={$extra['branchID']}&browseType=byModule&param={$module->id}");