<?php
 namespace App\Http\Controllers\Admin; use TechSoft\Laravel\Admin\Cms\BasicCms; use TechSoft\Laravel\Admin\Cms\CategoryCms; use TechSoft\Laravel\Admin\Cms\Field\FieldCategory; use TechSoft\Laravel\Admin\Cms\Field\FieldImage; use TechSoft\Laravel\Admin\Cms\Field\FieldRichtext; use TechSoft\Laravel\Admin\Cms\Field\FieldSwitch; use TechSoft\Laravel\Admin\Cms\Field\FieldText; use TechSoft\Laravel\Admin\Cms\Field\FieldTextarea; use TechSoft\Laravel\Admin\Support\AdminCheckController; use TechSoft\Laravel\MemberVip\MemberVipUtil; class MemberVipSetController extends AdminCheckController { private $cmsConfigData = [ 'model' => 'member_vip_set', 'pageTitle' => '会员等级', 'group' => 'data', 'maxLevel' => 1, 'canAdd' => true, 'canEdit' => true, 'canDelete' => true, 'canView' => true, 'canSort' => true, 'fields' => [ 'title' => ['type' => FieldText::class, 'title' => '名称', 'list' => true, 'add' => true, 'edit' => true, 'view' => true], 'flag' => ['type' => FieldText::class, 'title' => '英文标识', 'list' => true, 'add' => true, 'edit' => true, 'view' => true, 'desc' => '如 VIP1'], 'isDefault' => ['type' => FieldSwitch::class, 'title' => '会员是否默认为该等级', 'list' => true, 'add' => true, 'edit' => true, 'view' => true,], 'price' => ['type' => FieldText::class, 'title' => '价格', 'add' => true, 'edit' => true, 'view' => true, 'list' => true,], 'vipDays' => ['type' => FieldText::class, 'title' => '天数', 'add' => true, 'edit' => true, 'view' => true, 'list' => true,], 'quotaQuestionViewDaily' => ['type' => FieldText::class, 'title' => '每天看题数', 'add' => true, 'edit' => true, 'view' => true, 'list' => true,], 'content' => ['type' => FieldRichtext::class, 'title' => '说明', 'add' => true, 'edit' => true, 'view' => true,], ] ]; public function dataPostAdd(&$data) { MemberVipUtil::clearCache(); } public function dataPostEdit(&$data) { MemberVipUtil::clearCache(); } public function dataPostDelete(&$data) { MemberVipUtil::clearCache(); } public function dataList(CategoryCms $categoryCms) { return $categoryCms->executeList($this, $this->cmsConfigData); } public function dataAdd(CategoryCms $categoryCms) { return $categoryCms->executeAdd($this, $this->cmsConfigData); } public function dataEdit(CategoryCms $categoryCms) { return $categoryCms->executeEdit($this, $this->cmsConfigData); } public function dataDelete(CategoryCms $categoryCms) { return $categoryCms->executeDelete($this, $this->cmsConfigData); } public function dataView(CategoryCms $categoryCms) { return $categoryCms->executeView($this, $this->cmsConfigData); } public function dataSort(CategoryCms $categoryCms) { return $categoryCms->executeSort($this, $this->cmsConfigData); } }