<?php
 namespace App\Modules\User\Mobile; use App\Modules\Base\BaseMobileController; use Illuminate\Support\Facades\View; use TechOnline\Laravel\Dao\ModelUtil; use TechOnline\Laravel\Http\InputPackage; use TechOnline\Laravel\Http\Request; use TechOnline\Laravel\Http\Response; use TechSoft\Laravel\User\UserLoginCheck; class CreditController extends BaseMobileController implements UserLoginCheck { public static function 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]); if (empty($alias)) { return Response::send(-1, '页面不存在'); } if (Request::isPost()) { $page = InputPackage::buildFromInput()->getInteger('page', 1); $pageSize = 10; $option = []; $option['where'] = ['userId' => $this->userId()]; $option['order'] = ['id', 'desc']; $paginateData = ModelUtil::paginate('user_credit_log', $page, $pageSize, $option); if (empty($paginateData['records'])) { return Response::send(0, null, ['html' => null]); } $html = View::make('res::user.default.mobile.creditLogItem', [ 'records' => $paginateData['records'], ])->render(); return Response::send(0, null, ['html' => $html]); } return view('res::user.default.mobile.credit', [ 'memberUser' => $memberUser, ]); } }