src/Biz/Task/Job/CourseTaskCreateSyncJob.php

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Biz\Task\Job;

use Biz\Activity\Config\Activity;
use Biz\Activity\Dao\ActivityDao;
use Biz\AppLoggerConstant;
use Biz\Course\Copy\Chain\ActivityTestpaperCopy;
use Biz\Course\Dao\CourseChapterDao;
use Biz\Course\Dao\CourseDao;
use Biz\Course\Dao\CourseMaterialDao;
use Biz\System\Service\LogService;
use Biz\Task\Dao\TaskDao;
use Biz\Task\Service\TaskService;
use Codeages\Biz\Framework\Dao\BatchCreateHelper;
use Codeages\Biz\Framework\Event\Event;
use Codeages\Biz\Framework\Scheduler\AbstractJob;

class CourseTaskCreateSyncJob extends AbstractJob
{
    public function execute()
    {
        try {
            $task = $this->getTaskService()->getTask($this->args['taskId']);
            $copiedCourses = $this->getCourseDao()->findCoursesByParentIdAndLocked($task['courseId'], 1);

            $activity = $this->getActivityDao()->get($task['activityId']);

            $taskHelper = new BatchCreateHelper($this->getTaskDao());
            foreach ($copiedCourses as $cc) {
                $copiedTask = $this->getTaskService()->getCourseTaskByCourseIdAndCopyId($cc['id'], $task['id']);
                if (!empty($copiedTask)) {
                    continue;
                }
                $newActivity = $this->createActivity($activity, $cc);

                $newTask = array(
                    'courseId' => $cc['id'],
                    'fromCourseSetId' => $cc['courseSetId'],
                    'createdUserId' => $task['createdUserId'],
                    'seq' => $task['seq'],
                    'categoryId' => $task['categoryId'],
                    'activityId' => $newActivity['id'],
                    'title' => $task['title'],
                    'isFree' => $task['isFree'],
                    'isOptional' => $task['isOptional'],
                    'startTime' => $task['startTime'],
                    'endTime' => $task['endTime'],
                    'number' => $task['number'],
                    'mode' => $task['mode'],
                    'type' => $task['type'],
                    'mediaSource' => $task['mediaSource'],
                    'copyId' => $task['id'],
                    'maxOnlineNum' => $task['maxOnlineNum'],
                    'status' => $task['status'],
                    'length' => $task['length'],
                );

                //if (!empty($task['mode'])) {
                $newChapter = $this->getChapterDao()->getByCopyIdAndLockedCourseId($task['categoryId'], $cc['id']);

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。