diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index ced92450..b55f338a 100755 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -435,16 +435,19 @@ class Crud extends Command $modelName = $table = stripos($table, $prefix) === 0 ? substr($table, strlen($prefix)) : $table; $modelTableType = 'table'; $modelTableTypeName = $modelTableName = $modelName; - $modelTableInfo = $dbconnect->query("SHOW TABLE STATUS LIKE '{$modelTableName}'", [], true); - if (!$modelTableInfo) { - $modelTableType = 'name'; - $modelTableName = $prefix . $modelName; + $modelTableInfo = null; + if (!$input->getOption('delete')) { $modelTableInfo = $dbconnect->query("SHOW TABLE STATUS LIKE '{$modelTableName}'", [], true); if (!$modelTableInfo) { - throw new Exception("table not found"); + $modelTableType = 'name'; + $modelTableName = $prefix . $modelName; + $modelTableInfo = $dbconnect->query("SHOW TABLE STATUS LIKE '{$modelTableName}'", [], true); + if (!$modelTableInfo) { + throw new Exception("table not found"); + } } + $modelTableInfo = $modelTableInfo[0]; } - $modelTableInfo = $modelTableInfo[0]; $relations = []; //检查关联表 @@ -1081,7 +1084,7 @@ class Crud extends Command } //表注释 - $tableComment = $modelTableInfo['Comment']; + $tableComment = $modelTableInfo ? $modelTableInfo['Comment'] : ''; $tableComment = mb_substr($tableComment, -1) == '表' ? mb_substr($tableComment, 0, -1) . '管理' : $tableComment; $modelInit = ''; diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html index 0fd259a1..8faf4001 100644 --- a/application/admin/view/index/index.html +++ b/application/admin/view/index/index.html @@ -28,12 +28,12 @@
{if $fixedmenu}
- +
{/if} {if $referermenu}
- +
{/if}
diff --git a/public/assets/js/require-form.js b/public/assets/js/require-form.js index edc7250b..bd20b8dd 100755 --- a/public/assets/js/require-form.js +++ b/public/assets/js/require-form.js @@ -265,7 +265,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio var url = $(this).data("url") ? $(this).data("url") : (typeof Backend !== 'undefined' ? "general/attachment/select" : "user/attachment"); parent.Fast.api.open(url + "?element_id=" + $(this).attr("id") + "&multiple=" + multiple + "&mimetype=" + mimetype + "&admin_id=" + admin_id + "&user_id=" + user_id, __('Choose'), { callback: function (data) { - var button = $("#" + $(that).attr("id")); + var button = $(that); var maxcount = $(button).data("maxcount"); var input_id = $(button).data("input-id") ? $(button).data("input-id") : ""; maxcount = typeof maxcount !== "undefined" ? maxcount : 0;