<?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 ZfKst; OLnj6: $cRz_h->title(L('Admin Log')); goto aRY6d; ZfKst: $cRz_h = new Grid(AdminLog::class, function (Grid $cRz_h) { $cRz_h->display('id', L('ID'))->width(80); $cRz_h->select('adminUserId', L('Admin User'))->optionModel('admin_user', 'id', 'username'); $cRz_h->type('type', L('Type'))->type(AdminLogType::class)->width(100); $cRz_h->display('summary', L('Title')); $cRz_h->jsonKeyValue('data.content', L('Data')); $cRz_h->display('created_at', L('Created At'))->width(160); $cRz_h->gridFilter(function (GridFilter $XYn5i) { $XYn5i->eq('adminUserId', L('Admin User'))->selectModel('admin_user', 'id', 'username'); $XYn5i->like('summary', L('Title')); $XYn5i->eq('type', L('Type'))->radio(AdminLogType::class); }); }); goto ZQRQI; ZQRQI: $cRz_h->canAdd(false)->canEdit(false); goto CzqKd; vFdNT: $cRz_h->canMultiSelectItem(true)->canBatchDelete(true); goto OLnj6; CzqKd: $cRz_h->canDelete(AdminPermission::permit('AdminLogManage')); goto vFdNT; aRY6d: return $cRz_h; goto Dai90; Dai90: } protected function form() { $yfPYJ = new Form(AdminLog::class, function (Form $yfPYJ) { $yfPYJ->display('id', L('ID'))->editable(true); }); return $yfPYJ; } protected function detail() { goto UQNzZ; L82PN: return $uvktA; goto KbGjy; UQNzZ: $uvktA = new Detail(AdminLog::class, function (Detail $uvktA) { $uvktA->display('id', L('ID')); $uvktA->display('created_at', L('Created At')); $uvktA->type('type', L('Type'))->type(AdminLogType::class); $uvktA->display('summary', L('Title')); $uvktA->jsonKeyValue('data.content', L('Data')); }); goto c9v5H; c9v5H: $uvktA->title(L('Admin Log')); goto L82PN; KbGjy: } }