<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Web\Controller; use ModStart\App\Web\Layout\WebPage; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use ModStart\Field\AbstractField; use ModStart\Field\AutoRenderedFieldValue; use ModStart\Grid\Displayer\ItemOperate; use ModStart\Grid\Grid; use ModStart\Grid\GridFilter; use ModStart\ModStart; use ModStart\Module\ModuleBaseController; use ModStart\Repository\Filter\RepositoryFilter; use ModStart\Widget\Box; use ModStart\Widget\TextAction; use Module\Member\Auth\MemberUser; use Module\Member\Support\MemberLoginCheck; use Module\Member\Type\MemberMessageStatus; class MemberMessageController extends MemberFrameController implements MemberLoginCheck { private $api; public function __construct() { parent::__construct(); $this->api = app(\Module\Member\Api\Controller\MemberMessageController::class); } public function index(WebPage $j13Tr) { goto VRwv1; VRwv1: $ktizU = Grid::make('member_message'); goto yzmXr; ux6Ac: $ktizU->batchOperatePrepend('<button class="btn" data-batch-read-all><i class="iconfont icon-checked"></i> 全部已读</button>'); goto s2ny7; s2ny7: ModStart::scriptFile('module/Member/Web/Controller/memberMessage.js'); goto OxK4A; bckNK: $ktizU->disableCUD()->disableItemOperate(); goto Uoi2u; OxK4A: $ktizU->repositoryFilter(function (RepositoryFilter $wPpmz) { $wPpmz->where(array('userId' => MemberUser::id())); }); goto bckNK; Uoi2u: $ktizU->useSimple(function (AbstractField $UdGHQ, $Z32UA, $OPJGK) { return AutoRenderedFieldValue::makeView('module::Member.View.pc.memberMessage.item', array('item' => $Z32UA)); }); goto ZQbr5; ZQbr5: return $j13Tr->pageTitle('我的消息')->view($this->viewMemberFrame)->body(new Box($ktizU, '我的消息'))->handleGrid($ktizU); goto vX8XY; yzmXr: $ktizU->gridFilter(function (GridFilter $wPpmz) { $wPpmz->eq('status', '状态')->radio(MemberMessageStatus::class); }); goto ux6Ac; vX8XY: } public function delete() { return Response::sendFromGenerate($this->api->delete()); } public function read() { return Response::sendFromGenerate($this->api->read()); } public function readAll() { return Response::sendFromGenerate($this->api->readAll()); } }