<?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 $WLCMC) { goto dJilz; jZj3f: $ExhHT->gridFilter(function (GridFilter $zBPGV) { $zBPGV->eq('status', '状态')->radio(MemberMessageStatus::class); }); goto fDtZh; fDtZh: $ExhHT->batchOperatePrepend('<button class="btn" data-batch-read-all><i class="iconfont icon-checked"></i> 全部已读</button>'); goto gU4iq; JML_g: $ExhHT->useSimple(function (AbstractField $Wvq57, $FSL7c, $xZl3o) { return AutoRenderedFieldValue::makeView('module::Member.View.pc.memberMessage.item', array('item' => $FSL7c)); }); goto ff_T8; RVyq6: $ExhHT->disableCUD()->disableItemOperate(); goto JML_g; egNs2: $ExhHT->repositoryFilter(function (RepositoryFilter $zBPGV) { $zBPGV->where(array('userId' => MemberUser::id())); }); goto RVyq6; gU4iq: ModStart::scriptFile('module/Member/Web/Controller/memberMessage.js'); goto egNs2; dJilz: $ExhHT = Grid::make('member_message'); goto jZj3f; ff_T8: return $WLCMC->pageTitle('我的消息')->view($this->viewMemberFrame)->body(new Box($ExhHT, '我的消息'))->handleGrid($ExhHT); goto tkYk1; tkYk1: } 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()); } }