<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Core\Type\TypeUtil; use ModStart\Field\AbstractField; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; use Module\Member\Util\MemberCmsUtil; use Module\Member\Util\MemberVipUtil; use Module\Vendor\Type\OrderStatus; class MemberVipOrderController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $enw1u) { $enw1u->init('member_vip_order')->field(function ($enw1u) { $enw1u->display('id', '业务订单ID'); $enw1u->datetime('created_at', '创建时间'); $enw1u->display('memberUserId', '用户')->hookRendering(function (AbstractField $Wvq57, $FSL7c, $xZl3o) { return MemberCmsUtil::showFromId($FSL7c->memberUserId); }); $enw1u->display('type', '订单类型'); $enw1u->display('vipId', 'VIP')->hookRendering(function (AbstractField $Wvq57, $FSL7c, $xZl3o) { return MemberVipUtil::get($FSL7c->vipId, 'title'); }); $enw1u->display('payFee', '支付金额'); $enw1u->type('status', '状态')->type(OrderStatus::class); $enw1u->display('expire', '执行后会员过期时间')->width(200); })->gridFilter(function (GridFilter $zBPGV) { $zBPGV->eq('id', '业务订单ID'); $zBPGV->eq('memberUserId', '用户ID'); $zBPGV->eq('vipId', 'VIP')->select(MemberVipUtil::mapTitle()); $zBPGV->eq('status', '状态')->select(array(OrderStatus::WAIT_PAY => TypeUtil::name(OrderStatus::class, OrderStatus::WAIT_PAY), OrderStatus::COMPLETED => TypeUtil::name(OrderStatus::class, OrderStatus::COMPLETED))); })->disableCUD()->canShow(false)->title('用户-VIP订单'); } }