* [task#126383,doing,0.5h] Add the project of user create.

This commit is contained in:
xieqiyu
2024-09-04 17:31:41 +08:00
committed by 王于听
parent 222e43b29c
commit 9645472690
3 changed files with 35 additions and 1 deletions
+32
View File
@@ -141,6 +141,21 @@ class tutorialModel extends model
return $productStat;
}
/**
* 创建新手模式项目。
* Create project for tutorial;
*
* @param object $postData
* @access public
* @return object
*/
public function createProject(object $project): int
{
$guideInfo = $this->getGuideTaskName();
$this->session->set($guideInfo['guide'] . '_' . $guideInfo['guideTask'] . '_project', $project);
return 3;
}
/**
* 获取新手模式项目。
* Get project for tutorial;
@@ -227,6 +242,23 @@ class tutorialModel extends model
if($browseType && $browseType != 'all') $project->name .= '-' . $browseType; // Fix bug #21096
$projectStat[$project->id] = $project;
$guideInfo = $this->getGuideTaskName();
$sessionName = $guideInfo['guide'] . '_' . $guideInfo['guideTask'] . '_project';
if(!empty($_SESSION[$sessionName]))
{
$newProject = $this->getProject();
$newProject->id = 3;
$userProject = $this->session->{$sessionName};
foreach($userProject as $key => $value)
{
if(!empty($value)) $newProject->$key = $value;
}
$projectStat[$newProject->id] = $newProject;
}
return $projectStat;
}