<?php
 namespace App\Modules\User\Mobile; use App\Modules\Base\BaseMobileController; use TechOnline\Laravel\Dao\ModelUtil; use TechSoft\Laravel\User\UserLoginCheck; use Illuminate\Support\Facades\Request; class HomeController extends BaseMobileController implements UserLoginCheck { public static function owner() { static $owner = null; if ($owner) { return $owner; } $alias = Request::route('alias'); if (empty($alias)) { return 0; } $memberUser = ModelUtil::getWithCache('member_user', ['alias' => $alias]); if (empty($memberUser)) { return 0; } return $memberUser['id']; } public function index($alias) { $memberUser = ModelUtil::getWithCache('member_user', ['alias' => $alias]); $userCardSetting = ModelUtil::get('module_user_card_setting', ['memberUserId' => self::owner()]); if ($userCardSetting) { $userCardSetting['_item'] = ModelUtil::get('module_user_card_item', [ 'userId' => $this->userId(), 'memberUserId' => self::owner(), ]); } return view('res::user.default.mobile.home', [ 'memberUser' => $memberUser, 'userCardSetting' => $userCardSetting, ]); } }