<?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 $iXUoW) { goto oxGeE; BPoWN: $W3CVY->gridFilter(function (GridFilter $mHisM) { $mHisM->eq('status', '状态')->radio(MemberMessageStatus::class); }); goto GxUgQ; gbuwQ: $W3CVY->repositoryFilter(function (RepositoryFilter $mHisM) { $mHisM->where(array('userId' => MemberUser::id())); }); goto NZE3P; wB45K: $W3CVY->useSimple(function (AbstractField $jJyrp, $YaV4m, $DbHm9) { return AutoRenderedFieldValue::makeView('module::Member.View.pc.memberMessage.item', array('item' => $YaV4m)); }); goto brXk0; GxUgQ: $W3CVY->batchOperatePrepend('<button class="btn" data-batch-read-all><i class="iconfont icon-checked"></i> 全部已读</button>'); goto GNvVr; GNvVr: ModStart::scriptFile('module/Member/Web/Controller/memberMessage.js'); goto gbuwQ; oxGeE: $W3CVY = Grid::make('member_message'); goto BPoWN; NZE3P: $W3CVY->disableCUD()->disableItemOperate(); goto wB45K; brXk0: return $iXUoW->pageTitle('我的消息')->view($this->viewMemberFrame)->body(new Box($W3CVY, '我的消息'))->handleGrid($W3CVY); goto M9lxX; M9lxX: } 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()); } }