<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Faka\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; use Module\Faka\Type\ProductOrderProcessStatus; use Module\Faka\Type\ProductOrderStatus; class ProductOrderController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $A2Tuf) { $A2Tuf->init('faka_product_order')->field(function ($A2Tuf) { $A2Tuf->id('id', '业务订单ID')->editable(true); $A2Tuf->display('created_at', '创建时间')->editable(true); $A2Tuf->select('productId', '商品')->optionModel('faka_product', 'id', 'title'); $A2Tuf->type('status', '支付状态')->type(ProductOrderStatus::class); $A2Tuf->type('processStatus', '处理状态')->type(ProductOrderProcessStatus::class); $A2Tuf->display('amount', '数量'); $A2Tuf->currency('fee', '总费用'); $A2Tuf->currency('payFee', '支付金额'); $A2Tuf->display('email', '邮箱'); $A2Tuf->display('uid', 'UID')->listable(false); $A2Tuf->text('customField1', '字段1')->listable(false); $A2Tuf->text('customField2', '字段2')->listable(false); $A2Tuf->text('customField3', '字段3')->listable(false); $A2Tuf->text('customField4', '字段4')->listable(false); $A2Tuf->text('customField5', '字段5')->listable(false); $A2Tuf->text('remark', '备注')->listable(false); })->gridFilter(function (GridFilter $cbHm3) { $cbHm3->eq('id', '业务订单ID'); $cbHm3->eq('productId', '产品')->selectModel('faka_product', 'id', 'title'); $cbHm3->eq('status', '支付状态')->select(ProductOrderStatus::class); $cbHm3->eq('processStatus', '处理状态')->select(ProductOrderProcessStatus::class); })->disableCUD()->canShow(true)->canEdit(true)->title('发卡订单'); } }