src/Biz/Announcement/Processor/CourseAnnouncementProcessor.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Biz\Announcement\Processor;
use Biz\CloudPlatform\QueueJob\PushJob;
use Biz\Course\Service\CourseService;
use Biz\System\Service\SettingService;
use Codeages\Biz\Framework\Queue\Service\QueueService;
use Biz\User\Service\NotificationService;
class CourseAnnouncementProcessor extends AnnouncementProcessor
{
public function checkManage($targetId)
{
try {
$this->getCourseService()->tryManageCourse($targetId);
return true;
} catch (\Exception $e) {
return false;
}
}
public function checkTake($targetId)
{
return $this->getCourseService()->canTakeCourse($targetId);
}
public function getTargetShowUrl()
{
return 'course_show';
}
public function announcementNotification($targetId, $targetObject, $targetObjectShowUrl)
{
$conditions = array(
'courseId' => $targetId,
'role' => 'student',
);
$count = $this->getCourseMemberService()->countMembers($conditions);
$members = $this->getCourseMemberService()->findCourseStudents($targetId, 0, $count);
$result = false;
if ($members) {
$this->courseAnnouncementPush($targetId);
$message = array('title' => $targetObject['title'],
'url' => $targetObjectShowUrl,
'type' => 'course', );
foreach ($members as $member) {
$result = $this->getNotificationService()->notify($member['userId'], 'learn-notice', $message);
}
}
return $result;
}
private function courseAnnouncementPush($targetId)
{
if (!$this->isIMEnabled()) {
return;
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。