src/AppBundle/Controller/UserController.php
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace AppBundle\Controller;
use Biz\User\CurrentUser;
use AppBundle\Common\Paginator;
use Biz\User\UserException;
use Vip\Service\Vip\VipService;
use Biz\User\Service\AuthService;
use Biz\User\Service\UserService;
use Vip\Service\Vip\LevelService;
use AppBundle\Common\ArrayToolkit;
use Biz\Group\Service\GroupService;
use Biz\Course\Service\CourseService;
use Biz\Course\Service\MemberService;
use Biz\Course\Service\ThreadService;
use Biz\System\Service\SettingService;
use Biz\User\Service\UserFieldService;
use Biz\Course\Service\CourseSetService;
use Biz\Course\Service\CourseNoteService;
use Biz\User\Service\NotificationService;
use Biz\Classroom\Service\ClassroomService;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Common\SmsToolkit;
class UserController extends BaseController
{
public function headerBlockAction($user)
{
$userProfile = $this->getUserService()->getUserProfile($user['id']);
$user = array_merge($user, $userProfile);
if ($this->getCurrentUser()->isLogin()) {
$isFollowed = $this->getUserService()->isFollowed($this->getCurrentUser()->id, $user['id']);
} else {
$isFollowed = false;
}
// 关注数
$following = $this->getUserService()->findUserFollowingCount($user['id']);
// 粉丝数
$follower = $this->getUserService()->findUserFollowerCount($user['id']);
return $this->render('user/header-block.html.twig', array(
'user' => $user,
'isFollowed' => $isFollowed,
'following' => $following,
'follower' => $follower,
));
}
public function showAction(Request $request, $id)
{
$user = $this->tryGetUser($id);
$userProfile = $this->getUserService()->getUserProfile($user['id']);
$userProfile['about'] = strip_tags($userProfile['about'], '');
$userProfile['about'] = preg_replace('/ /', '', $userProfile['about']);
$user = array_merge($user, $userProfile);
if (in_array('ROLE_TEACHER', $user['roles'])) {
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。