+ [refac] add a method to create browse link of a scene module.

This commit is contained in:
liugang
2025-07-10 14:30:00 +08:00
parent 774a519cc6
commit 84f44599d0
+24
View File
@@ -1344,6 +1344,30 @@ class treeModel extends model
return $data;
}
/**
* 生成测试场景的链接。
* Create module of a scene.
*
* @param string $type
* @param object $module
* @param string $parent
* @param array|string $extra
* @access public
* @return object
*/
public function createSceneLink(string $type, object $module, string $parent, array|string $extra = array()): object
{
$orderBy = $extra['orderBy'] ?? 'id_desc';
$data = new stdclass();
$data->id = (string)$module->id;
$data->parent = $parent && empty($module->parent) ? $parent : (string)$module->parent;
$data->name = $module->name;
$data->url = helper::createLink('testcase', 'browseScene', "productID={$module->root}&branch=$branch&moduleID={$module->id}&orderBy=$orderBy");
return $data;
}
/**
* 生成测试任务的链接。
* Create link of a test task.