<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PayCenter\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Grid\Displayer\ItemOperate; use ModStart\Grid\GridFilter; use ModStart\Repository\Filter\RepositoryFilter; use ModStart\Support\Concern\HasFields; use Module\PayCenter\Biz\PayCenterBiz; use Module\PayCenter\Type\PayOrderStatus; use Module\PayCenter\Type\PayType; class PayOrderRefundController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $P2vse) { $P2vse->init('pay_order')->field(function ($P2vse) { $P2vse->id('id', '结算ID'); $P2vse->select('biz', '业务')->options(PayCenterBiz::allMap()); $P2vse->text('bizId', '业务订单ID'); $P2vse->type('status', '状态')->type(PayOrderStatus::class); $P2vse->type('payType', '支付类型')->type(PayType::class); $P2vse->currency('feeTotal', '金额'); $P2vse->text('body', '内容'); $P2vse->display('created_at', L('Created At')); $P2vse->display('updated_at', L('Updated At'))->listable(false); })->repositoryFilter(function (RepositoryFilter $mHisM) { $mHisM->whereIn('status', array(PayOrderStatus::REFUND, PayOrderStatus::REFUND_SUCCESS, PayOrderStatus::REFUNDING)); })->gridFilter(function (GridFilter $mHisM) { $mHisM->eq('id', '结算ID'); $mHisM->eq('biz', '业务')->select(PayCenterBiz::allMap()); $mHisM->eq('status', '状态')->select(PayOrderStatus::class); $mHisM->eq('payType', '支付类型')->select(PayType::class); })->operateFixed('right')->hookItemOperateRendering(function (ItemOperate $CVjnG) { $YaV4m = $CVjnG->item(); switch ($YaV4m->status) { case PayOrderStatus::PAYED: break; } })->disableCUD()->title('退款订单'); } }