<?php
 namespace App\Http\Controllers\Main; use App\Http\Controllers\BaseController; use App\Util\QuestionUtil; use TechOnline\Utils\FileUtil; use TechSoft\Laravel\Banner\BannerUtil; use TechSoft\Laravel\Member\Traits\MemberAccountWebControllerTrait; use TechSoft\Laravel\Partner\PartnerUtil; class IndexController extends BaseController { use MemberAccountWebControllerTrait; public function index() { $banners = BannerUtil::listByPositionWithCache($this->isMobile() ? 'mHome' : 'pcHome'); $tags = QuestionUtil::getTags(); $partners = PartnerUtil::listByPositionWithCache('pcHome'); $option = []; $option['order'] = ['id', 'desc']; $paginateData = QuestionUtil::paginateQuestion(1, 10, $option); $latestQuestions = $paginateData['records']; return $this->_view('index', compact('banners', 'tags', 'partners', 'latestQuestions')); } } 