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