From fa2992687b3b9fddfef48847a94f8bda19065cd8 Mon Sep 17 00:00:00 2001 From: Karson Date: Thu, 26 Jun 2025 17:03:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96CRUD=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Crud.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index 361cce7a..01e12f8a 100755 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -493,20 +493,20 @@ class Crud extends Command //关联模式 'relationFields' => isset($relationFields[$index]) ? explode(',', $relationFields[$index]) : [], //关联模式 - 'relationMode' => isset($relationMode[$index]) ? $relationMode[$index] : 'belongsto', + 'relationMode' => $relationMode[$index] ?? 'belongsto', //关联模型控制器 - 'relationController' => isset($relationController[$index]) ? $relationController[$index] : '', + 'relationController' => $relationController[$index] ?? '', //关联表外键 - 'relationForeignKey' => isset($relationForeignKey[$index]) ? $relationForeignKey[$index] : '', + 'relationForeignKey' => $relationForeignKey[$index] ?? '', //关联表主键 - 'relationPrimaryKey' => isset($relationPrimaryKey[$index]) ? $relationPrimaryKey[$index] : '', + 'relationPrimaryKey' => $relationPrimaryKey[$index] ?? '', ]; } } //根据表名匹配对应的Fontawesome图标 - $iconPath = ROOT_PATH . str_replace('/', DS, '/public/assets/libs/font-awesome/less/variables.less'); - $iconName = is_file($iconPath) && stripos(file_get_contents($iconPath), '@fa-var-' . $table . ':') ? 'fa fa-' . $table : 'fa fa-circle-o'; + $iconPath = ROOT_PATH . str_replace('/', DS, '/public/assets/libs/font-awesome/css/font-awesome.css'); + $iconName = is_file($iconPath) && stripos(file_get_contents($iconPath), '.fa-' . $table . ' {') ? 'fa fa-' . $table : 'fa fa-circle-o'; //控制器 list($controllerNamespace, $controllerName, $controllerFile, $controllerArr) = $this->getControllerData($moduleName, $controller, $table);