<?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 q2Toj; nnYcH: return $jfjOt; goto uiPtv; iVJKb: $jfjOt->canDelete(AdminPermission::permit('AdminLogManage')); goto osnfx; osnfx: $jfjOt->canMultiSelectItem(true)->canBatchDelete(true); goto fXQG2; q2Toj: $jfjOt = new Grid(AdminLog::class, function (Grid $jfjOt) { $jfjOt->display('id', L('ID'))->width(80); $jfjOt->select('adminUserId', L('Admin User'))->optionModel('admin_user', 'id', 'username'); $jfjOt->type('type', L('Type'))->type(AdminLogType::class)->width(100); $jfjOt->display('summary', L('Title')); $jfjOt->jsonKeyValue('data.content', L('Data')); $jfjOt->display('created_at', L('Created At'))->width(160); $jfjOt->gridFilter(function (GridFilter $geg6A) { $geg6A->eq('adminUserId', L('Admin User'))->selectModel('admin_user', 'id', 'username'); $geg6A->like('summary', L('Title')); $geg6A->eq('type', L('Type'))->radio(AdminLogType::class); }); }); goto KTETc; KTETc: $jfjOt->canAdd(false)->canEdit(false); goto iVJKb; fXQG2: $jfjOt->title(L('Admin Log')); goto nnYcH; uiPtv: } protected function form() { $wDk8k = new Form(AdminLog::class, function (Form $wDk8k) { $wDk8k->display('id', L('ID'))->editable(true); }); return $wDk8k; } protected function detail() { goto wxH5x; wxH5x: $dZIpH = new Detail(AdminLog::class, function (Detail $dZIpH) { $dZIpH->display('id', L('ID')); $dZIpH->display('created_at', L('Created At')); $dZIpH->type('type', L('Type'))->type(AdminLogType::class); $dZIpH->display('summary', L('Title')); $dZIpH->jsonKeyValue('data.content', L('Data')); }); goto cdK3z; cdK3z: $dZIpH->title(L('Admin Log')); goto uCgLl; uCgLl: return $dZIpH; goto kwkn4; kwkn4: } }