<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Auth\AdminPermission; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\Response; use ModStart\Core\Util\CRUDUtil; use ModStart\Field\AbstractField; use ModStart\Form\Form; use ModStart\Grid\Displayer\ItemOperate; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; use ModStart\Widget\TextAjaxRequest; use Module\Member\Type\MemberMoneyCashStatus; use Module\Member\Type\MemberMoneyCashType; use Module\Member\Util\MemberCmsUtil; use Module\Member\Util\MemberVipUtil; class MemberMoneyCashController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $enw1u) { $enw1u->init('member_money_cash')->field(function ($enw1u) { $enw1u->id('id', 'ID'); $enw1u->display('memberUserId', '用户')->hookRendering(function (AbstractField $Wvq57, $FSL7c, $xZl3o) { return MemberCmsUtil::showFromId($FSL7c->memberUserId); }); $enw1u->type('status', '状态')->type(MemberMoneyCashStatus::class); $enw1u->text('money', '金额'); $enw1u->text('moneyAfterTax', '到账金额'); $enw1u->text('remark', '备注'); $enw1u->type('type', '账号类型')->type(MemberMoneyCashType::class); $enw1u->text('realname', '姓名'); $enw1u->text('account', '账号'); $enw1u->display('created_at', L('Created At')); })->gridFilter(function (GridFilter $zBPGV) { $zBPGV->eq('status', '状态')->radio(MemberMoneyCashStatus::class); })->hookItemOperateRendering(function (ItemOperate $TZSL3) { $FSL7c = $TZSL3->item(); switch ($FSL7c->status) { case MemberMoneyCashStatus::VERIFYING: $TZSL3->prepend(TextAjaxRequest::primary('已汇款', action('\\' . __CLASS__ . '@pass', array('_id' => $FSL7c->id)))); break; } })->gridFilter(function (GridFilter $zBPGV) { $zBPGV->eq('memberUserId', '用户ID'); })->title('用户钱包提现申请')->canAdd(false)->canEdit(false)->canDelete(false); } public function pass() { goto AGZIq; kEYu3: return Response::redirect(CRUDUtil::jsGridRefresh()); goto Y2J_X; uYkXi: ModelUtil::update('member_money_cash', $StE5h, array('status' => MemberMoneyCashStatus::SUCCESS)); goto kEYu3; ZqWPx: $StE5h = CRUDUtil::id(); goto uYkXi; AGZIq: AdminPermission::demoCheck(); goto ZqWPx; Y2J_X: } }