<?php
 namespace App\Http\Controllers\Main; use App\Http\Controllers\BaseController; use App\Types\MemberFavoriteCategory; use TechOnline\Laravel\Dao\ModelUtil; use TechOnline\Laravel\Http\InputPackage; use TechOnline\Laravel\Http\Request; use TechOnline\Utils\PageHtmlUtil; use TechSoft\Laravel\Member\Interfaces\MemberLoginCheck; use TechSoft\Laravel\MemberFavorite\MemberFavoriteApiControllerTrait; use TechSoft\Laravel\MemberFavorite\MemberFavoriteUtil; class MemberFavoriteController extends BaseController implements MemberLoginCheck { use MemberFavoriteApiControllerTrait; public function question() { $input = InputPackage::buildFromInput(); $page = $input->getInteger('page'); $pageSize = 10; $option = []; $option['where'] = []; $option['order'] = ['id', 'desc']; $paginateData = MemberFavoriteUtil::paginate($this->memberUserId(), MemberFavoriteCategory::QUESTION, $page, $pageSize, $option); $pageHtml = PageHtmlUtil::render($paginateData['total'], $pageSize, $page, '?' . Request::mergeQueries(['page' => ['{page}']])); ModelUtil::join($paginateData['records'], 'categoryId', '_question', 'question', 'id'); return $this->_view('memberFavorite.question', [ 'records' => $paginateData['records'], 'pageHtml' => $pageHtml, ]); } }