<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Shop\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Form\Form; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; use Module\Shop\Util\GoodsCategoryUtil; class GoodsCategoryController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $P2vse) { $P2vse->init('goods_category')->field(function ($P2vse) { $P2vse->id('id', 'ID'); $P2vse->text('title', '名称'); $P2vse->image('cover', '图标'); $P2vse->text('desc', '描述'); $P2vse->switch('visibleHome', '首页显示')->gridEditable(true)->width(100); $P2vse->display('created_at', L('Created At'))->listable(false); $P2vse->display('updated_at', L('Updated At'))->listable(false); })->gridFilter(function (GridFilter $mHisM) { $mHisM->eq('id', L('ID')); $mHisM->like('title', L('Title')); })->title('商品分类')->asTree()->hookChanged(function (Form $NX6uw) { GoodsCategoryUtil::clearCache(); })->treeMaxLevel(2); } }