diff --git a/module/tree/model.php b/module/tree/model.php index 3fb1ccc27c..075511b4f6 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -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.