<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Auth\AdminPermission; use ModStart\Admin\Concern\HasAdminCRUD; use ModStart\Admin\Model\AdminLog; use ModStart\Admin\Type\AdminLogType; use ModStart\Detail\Detail; use ModStart\Form\Form; use ModStart\Grid\Grid; use ModStart\Grid\GridFilter; class AdminLogController extends Controller { use HasAdminCRUD; protected function grid() { goto ksDnx; UFAVG: $xtA75->title(L('Admin Log')); goto xC8FZ; M7TN3: $xtA75->canDelete(AdminPermission::permit('AdminLogManage')); goto XlEDz; ksDnx: $xtA75 = new Grid(AdminLog::class, function (Grid $xtA75) { $xtA75->display('id', L('ID'))->width(80); $xtA75->select('adminUserId', L('Admin User'))->optionModel('admin_user', 'id', 'username'); $xtA75->type('type', L('Type'))->type(AdminLogType::class)->width(100); $xtA75->display('summary', L('Title')); $xtA75->jsonKeyValue('data.content', L('Data')); $xtA75->display('created_at', L('Created At'))->width(160); $xtA75->gridFilter(function (GridFilter $udDBo) { $udDBo->eq('adminUserId', L('Admin User'))->selectModel('admin_user', 'id', 'username'); $udDBo->like('summary', L('Title')); $udDBo->eq('type', L('Type'))->radio(AdminLogType::class); }); }); goto vYvoU; vYvoU: $xtA75->canAdd(false)->canEdit(false); goto M7TN3; xC8FZ: return $xtA75; goto pUV3M; XlEDz: $xtA75->canMultiSelectItem(true)->canBatchDelete(true); goto UFAVG; pUV3M: } protected function form() { $LEyIF = new Form(AdminLog::class, function (Form $LEyIF) { $LEyIF->display('id', L('ID'))->editable(true); }); return $LEyIF; } protected function detail() { goto nMn26; WgBCL: return $jV5dI; goto SUIlv; nMn26: $jV5dI = new Detail(AdminLog::class, function (Detail $jV5dI) { $jV5dI->display('id', L('ID')); $jV5dI->display('created_at', L('Created At')); $jV5dI->type('type', L('Type'))->type(AdminLogType::class); $jV5dI->display('summary', L('Title')); $jV5dI->jsonKeyValue('data.content', L('Data')); }); goto zh42h; zh42h: $jV5dI->title(L('Admin Log')); goto WgBCL; SUIlv: } }