<?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 MBH2R; YGo5f: $TzF5r->canMultiSelectItem(true)->canBatchDelete(true); goto nOgXS; MBH2R: $TzF5r = new Grid(AdminLog::class, function (Grid $TzF5r) { $TzF5r->display('id', L('ID'))->width(80); $TzF5r->select('adminUserId', L('Admin User'))->optionModel('admin_user', 'id', 'username'); $TzF5r->type('type', L('Type'))->type(AdminLogType::class)->width(100); $TzF5r->display('summary', L('Title')); $TzF5r->jsonKeyValue('data.content', L('Data')); $TzF5r->display('created_at', L('Created At'))->width(160); $TzF5r->gridFilter(function (GridFilter $z8oGH) { $z8oGH->eq('adminUserId', L('Admin User'))->selectModel('admin_user', 'id', 'username'); $z8oGH->like('summary', L('Title')); $z8oGH->eq('type', L('Type'))->radio(AdminLogType::class); }); }); goto d3FqN; HyMiN: return $TzF5r; goto tpm3r; nOgXS: $TzF5r->title(L('Admin Log')); goto HyMiN; d3FqN: $TzF5r->canAdd(false)->canEdit(false); goto q4WYn; q4WYn: $TzF5r->canDelete(AdminPermission::permit('AdminLogManage')); goto YGo5f; tpm3r: } protected function form() { $aDbJm = new Form(AdminLog::class, function (Form $aDbJm) { $aDbJm->display('id', L('ID'))->editable(true); }); return $aDbJm; } protected function detail() { goto qTJNb; pwysu: return $S8rqk; goto s12GQ; D8KAV: $S8rqk->title(L('Admin Log')); goto pwysu; qTJNb: $S8rqk = new Detail(AdminLog::class, function (Detail $S8rqk) { $S8rqk->display('id', L('ID')); $S8rqk->display('created_at', L('Created At')); $S8rqk->type('type', L('Type'))->type(AdminLogType::class); $S8rqk->display('summary', L('Title')); $S8rqk->jsonKeyValue('data.content', L('Data')); }); goto D8KAV; s12GQ: } }