<?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 $IuwRA) { $IuwRA->init('member_money_cash')->field(function ($IuwRA) { $IuwRA->id('id', 'ID'); $IuwRA->display('memberUserId', '用户')->hookRendering(function (AbstractField $UdGHQ, $Z32UA, $OPJGK) { return MemberCmsUtil::showFromId($Z32UA->memberUserId); }); $IuwRA->type('status', '状态')->type(MemberMoneyCashStatus::class); $IuwRA->text('money', '金额'); $IuwRA->text('moneyAfterTax', '到账金额'); $IuwRA->text('remark', '备注'); $IuwRA->type('type', '账号类型')->type(MemberMoneyCashType::class); $IuwRA->text('realname', '姓名'); $IuwRA->text('account', '账号'); $IuwRA->display('created_at', L('Created At')); })->gridFilter(function (GridFilter $wPpmz) { $wPpmz->eq('status', '状态')->radio(MemberMoneyCashStatus::class); })->hookItemOperateRendering(function (ItemOperate $PlL0g) { $Z32UA = $PlL0g->item(); switch ($Z32UA->status) { case MemberMoneyCashStatus::VERIFYING: $PlL0g->prepend(TextAjaxRequest::primary('已汇款', action('\\' . __CLASS__ . '@pass', array('_id' => $Z32UA->id)))); break; } })->gridFilter(function (GridFilter $wPpmz) { $wPpmz->eq('memberUserId', '用户ID'); })->title('用户钱包提现申请')->canAdd(false)->canEdit(false)->canDelete(false); } public function pass() { goto MTeFH; gwm0U: return Response::redirect(CRUDUtil::jsGridRefresh()); goto LFbgv; T1udC: ModelUtil::update('member_money_cash', $M3rBS, array('status' => MemberMoneyCashStatus::SUCCESS)); goto gwm0U; CONJ4: $M3rBS = CRUDUtil::id(); goto T1udC; MTeFH: AdminPermission::demoCheck(); goto CONJ4; LFbgv: } }