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