<?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 $JcqUq) { goto m3XZp; wjcWA: $gwmIt->repositoryFilter(function (RepositoryFilter $bu01d) { $bu01d->where(array('userId' => MemberUser::id())); }); goto xZS74; g62CP: return $JcqUq->pageTitle('我的消息')->view($this->viewMemberFrame)->body(new Box($gwmIt, '我的消息'))->handleGrid($gwmIt); goto bmqUk; m3XZp: $gwmIt = Grid::make('member_message'); goto AXVPZ; Z3FLz: $gwmIt->useSimple(function (AbstractField $pZ_lR, $jIWZA, $aaYHa) { return AutoRenderedFieldValue::makeView('module::Member.View.pc.memberMessage.item', array('item' => $jIWZA)); }); goto g62CP; xZS74: $gwmIt->disableCUD()->disableItemOperate(); goto Z3FLz; AXVPZ: $gwmIt->gridFilter(function (GridFilter $bu01d) { $bu01d->eq('status', '状态')->radio(MemberMessageStatus::class); }); goto ITTH2; Og796: ModStart::scriptFile('module/Member/Web/Controller/memberMessage.js'); goto wjcWA; ITTH2: $gwmIt->batchOperatePrepend('<button class="btn" data-batch-read-all><i class="iconfont icon-checked"></i> 全部已读</button>'); goto Og796; bmqUk: } 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()); } }