<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\News\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; class NewsCategoryController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $NXyDB) { $NXyDB->init('news_category')->field(function ($NXyDB) { $NXyDB->id('id', 'ID'); $NXyDB->text('title', '名称'); $NXyDB->display('created_at', L('Created At'))->listable(false); $NXyDB->display('updated_at', L('Updated At'))->listable(false); })->gridFilder(function (GridFilter $EFNvu) { $EFNvu->eq('id', L('ID')); $EFNvu->like('title', L('Title')); })->title('新闻资讯分类')->asTree()->treeMaxLevel(1); } }