<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Tracking\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Core\Dao\ModelUtil; use ModStart\Field\AbstractField; use ModStart\Field\AutoRenderedFieldValue; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; class CodeQueryController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $P0Vsm) { $P0Vsm->init('tracking_code_query')->field(function ($P0Vsm) { $P0Vsm->id('id', 'ID'); $P0Vsm->display('codeId', '防伪码')->hookRendering(function (AbstractField $aR4e2, $lDvaK, $POXOb) { $MipNh = ModelUtil::get('tracking_code', $lDvaK->codeId); return AutoRenderedFieldValue::make($MipNh['code']); }); $P0Vsm->text('ua', '浏览器'); $P0Vsm->text('ip', 'IP'); $P0Vsm->display('created_at', L('Created At'))->listable(false); $P0Vsm->display('updated_at', L('Updated At'))->listable(false); })->gridFilter(function (GridFilter $roX32) { $roX32->eq('id', L('ID')); $roX32->eq('codeId', '防伪码ID'); })->title('溯源流程'); } }