src/Biz/Course/Copy/CourseSet/CourseSetCopy.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Biz\Course\Copy\CourseSet;
use Biz\AbstractCopy;
use Biz\Course\Dao\CourseSetDao;
class CourseSetCopy extends AbstractCopy
{
public function preCopy($source, $options)
{
}
protected function getFields()
{
return array(
'type',
'title',
'subtitle',
'tags',
'categoryId',
'serializeMode',
'summary',
'goals',
'audiences',
'cover',
'categoryId',
'recommended',
'recommendedSeq',
'recommendedTime',
'orgId',
'orgCode',
'teacherIds',
'materialNum',
);
}
public function doCopy($courseSet, $options)
{
//tudo 班级复制课程的 teacherIds,materialNum有误,需要在复制结束前update
$currentNode = $this->getCopyChain();
$currentUser = $this->biz['user'];
$newCourseSet = $this->partsFields($courseSet);
$newCourseSet['status'] = 'draft';
if (!empty($options['params']['title'])) {
$newCourseSet['title'] = $options['params']['title'];
}
if (!empty($currentNode['isCopy'])) {
$newCourseSet['locked'] = 1; // 默认锁定
$newCourseSet['parentId'] = $courseSet['id'];
$newCourseSet['status'] = 'published';
}
$newCourseSet['creator'] = $currentUser->getId();
$newCourseSet = $this->getCourseSetDao()->create($newCourseSet);
return array('newCourseSet' => $newCourseSet);
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。