<?php
 namespace App\Http\Controllers\Main; use App\Http\Controllers\BaseController; use TechOnline\Laravel\Dao\ModelUtil; use TechSoft\Laravel\Banner\BannerUtil; use TechSoft\Laravel\Forum\Types\ThreadStatus; use TechSoft\Laravel\Member\Traits\MemberAccountWebControllerTrait; use TechSoft\Laravel\Forum\ForumUtil; use TechSoft\Laravel\Partner\PartnerUtil; class IndexController extends BaseController { public function index() { $latestThreads = ForumUtil::listLatestThreads(8); $hottestThreads = ModelUtil::model('forum_thread') ->where('status', ThreadStatus::VERIFY_PASS) ->limit(8)->orderBy('lastReplyMemberUserId', 'desc')->get()->toArray(); $banners = BannerUtil::listByPositionWithCache('pcHome'); ModelUtil::join($latestThreads, 'memberUserId', '_memberUser', 'member_user', 'id'); ModelUtil::join($hottestThreads, 'memberUserId', '_memberUser', 'member_user', 'id'); $viewData = []; $viewData['banners'] = $banners; $viewData['latestThreads'] = $latestThreads; $viewData['hottestThreads'] = $hottestThreads; $viewData['partners'] = PartnerUtil::listByPositionWithCache('home'); return $this->_view('index', $viewData); } public function demo() { return $this->_view('demo'); } }