<?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 $A2Tuf) { $A2Tuf->init('pay_order')->field(function ($A2Tuf) { $A2Tuf->id('id', '结算ID'); $A2Tuf->select('biz', '业务')->options(PayCenterBiz::allMap()); $A2Tuf->text('bizId', '业务订单ID'); $A2Tuf->type('status', '状态')->type(PayOrderStatus::class); $A2Tuf->type('payType', '支付类型')->type(PayType::class); $A2Tuf->currency('feeTotal', '金额'); $A2Tuf->text('body', '内容'); $A2Tuf->display('created_at', L('Created At')); $A2Tuf->display('updated_at', L('Updated At'))->listable(false); })->repositoryFilter(function (RepositoryFilter $cbHm3) { $cbHm3->whereIn('status', array(PayOrderStatus::REFUND, PayOrderStatus::REFUND_SUCCESS, PayOrderStatus::REFUNDING)); })->gridFilter(function (GridFilter $cbHm3) { $cbHm3->eq('id', '结算ID'); $cbHm3->eq('biz', '业务')->select(PayCenterBiz::allMap()); $cbHm3->eq('status', '状态')->select(PayOrderStatus::class); $cbHm3->eq('payType', '支付类型')->select(PayType::class); })->operateFixed('right')->hookItemOperateRendering(function (ItemOperate $i3KYf) { $vPOhn = $i3KYf->item(); switch ($vPOhn->status) { case PayOrderStatus::PAYED: break; } })->disableCUD()->title('退款订单'); } }