src/AppBundle/Handler/GenerateNotificationHandler.php

(开头部分) 1KB

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

<?php

namespace AppBundle\Handler;

use Biz\CloudPlatform\QueueJob\PushJob;
use Biz\User\CurrentUser;
use AppBundle\Common\ArrayToolkit;
use Biz\Course\Service\MemberService;
use Biz\System\Service\SettingService;
use Codeages\Biz\Framework\Context\Biz;
use Biz\CloudPlatform\Service\AppService;
use Biz\User\Service\NotificationService;
use Codeages\Biz\Framework\Queue\Service\QueueService;
use VipPlugin\Biz\Vip\Service\LevelService;
use VipPlugin\Biz\Vip\Service\VipService;
use Biz\Classroom\Service\ClassroomService;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
use Biz\Course\Util\CourseTitleUtils;

class GenerateNotificationHandler
{
    /**
     * @var ContainerInterface
     */
    private $container;

    /**
     * @var Biz
     */
    private $biz;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
        $this->biz = $this->container->get('biz');
    }

    /**
     * Do the magic.
     *
     * @param InteractiveLoginEvent $event
     */
    public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
    {
        $user = $this->biz['user'];

        $this->sendCoursesOverdueNotification($user);

        $this->sendClassroomsOverdueNotification($user);

        $this->sendVipsOverdueNotification($user);
    }

    protected function sendCoursesOverdueNotification(CurrentUser $user)
    {
        list($courses, $courseMembers) = $this->getCourseMemberService()->findWillOverdueCourses();
        $courseMembers = ArrayToolkit::index($courseMembers, 'courseId');

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

AI 解读 AI

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

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