<?php
 namespace Module\Paper\Web\Controller; use Illuminate\Support\Facades\View; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use ModStart\Core\Util\PageHtmlUtil; use ModStart\Module\ModuleBaseController; use Module\Member\Support\MemberLoginCheck; class PaperExamMemberController extends ModuleBaseController implements MemberLoginCheck { private $api; private $viewMemberFrame; public function __construct() { list($this->viewMemberFrame, $_) = $this->viewPaths('member.frame'); View::share('_viewMemberFrame', $this->viewMemberFrame); $this->api = app(\Module\Paper\Api\Controller\PaperExamMemberController::class); } public function index() { $result = Response::tryGetData($this->api->paginate()); $pageHtml = PageHtmlUtil::render($result['total'], $result['pageSize'], $result['page'], '?' . Request::mergeQueries(['page' => ['{page}']])); return $this->view('memberPaperExam.list', [ 'paperExams' => $result['records'], 'pageHtml' => $pageHtml, 'pageTitle' => '我的考试', ]); } public function views($id) { InputPackage::mergeToInput('id', $id); $result = Response::tryGetData($this->api->get($id)); return $this->view('memberPaperExam.view', [ 'paper' => $result['paper'], 'paperExam' => $result['paperExam'], 'paperQuestions' => $result['paperQuestions'], 'paperExamQuestions' => $result['paperExamQuestions'], 'pageTitle' => '考试查看', ]); } }