<?php
 namespace App\Http\Controllers\Admin; use TechOnline\Laravel\Dao\ModelUtil; use TechOnline\Laravel\Type\TypeUtil; use TechSoft\Laravel\Admin\Cms\BasicCms; use TechSoft\Laravel\Admin\Cms\Field\FieldDate; use TechSoft\Laravel\Admin\Cms\Field\FieldRichtext; use TechSoft\Laravel\Admin\Cms\Field\FieldSelect; use TechSoft\Laravel\Admin\Cms\Field\FieldText; use TechSoft\Laravel\Admin\Support\AdminCheckController; use TechSoft\Laravel\Admin\Util\AdminCmsUtil; use TechSoft\Laravel\Shop\Types\OrderStatus; class MemberVipOrderController extends AdminCheckController { private $cmsConfigData = [ 'model' => 'member_vip_order', 'pageTitle' => '会员VIP订单', 'group' => 'data', 'fields' => [ 'memberUserId' => ['type' => FieldText::class, 'title' => '用户', 'list' => true, 'add' => true, 'edit' => true, 'view' => true,], 'type' => ['type' => FieldText::class, 'title' => '操作类型', 'list' => true, 'add' => true, 'edit' => true, 'view' => true,], 'vipId' => ['type' => FieldText::class, 'title' => '会员', 'list' => true, 'add' => true, 'edit' => true, 'view' => true,], 'payFee' => ['type' => FieldText::class, 'title' => '支付金额', 'list' => true, 'add' => true, 'edit' => true, 'view' => true,], 'status' => ['type' => FieldSelect::class, 'title' => '状态', 'list' => true, 'add' => true, 'edit' => true, 'view' => true, 'search' => true, 'options' => [],], 'expire' => ['type' => FieldDate::class, 'title' => '操作后会员过期', 'list' => true, 'add' => true, 'edit' => true, 'view' => true,], ] ]; public function __construct() { parent::__construct(); $this->cmsConfigData['fields']['status']['options'] = [ OrderStatus::WAIT_PAY => TypeUtil::name(OrderStatus::class, OrderStatus::WAIT_PAY), OrderStatus::COMPLETED => TypeUtil::name(OrderStatus::class, OrderStatus::COMPLETED), ]; } public function dataProcessView(&$item, &$record) { $item['memberUserId'] = AdminCmsUtil::memberUserId($record['memberUserId'], '\App\Http\Controllers\Admin\MemberController@dataView'); $item['status'] = AdminCmsUtil::colorText($record['status'], OrderStatus::class); } public function dataList(BasicCms $basicCms) { return $basicCms->executeList($this, $this->cmsConfigData); } public function dataAdd(BasicCms $basicCms) { return $basicCms->executeAdd($this, $this->cmsConfigData); } public function dataEdit(BasicCms $basicCms) { return $basicCms->executeEdit($this, $this->cmsConfigData); } public function dataDelete(BasicCms $basicCms) { return $basicCms->executeDelete($this, $this->cmsConfigData); } public function dataView(BasicCms $basicCms) { return $basicCms->executeView($this, $this->cmsConfigData); } }