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