diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index 8fc7a8861e65db83e92e61338528aae5e1151eba..a713cc0aab0289ff8a7d59dcdf4d3b28d0d865b1 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -3,7 +3,6 @@ namespace app\admin\controller; use app\common\controller\Backend; -use fast\Http; use think\addons\AddonException; use think\addons\Service; use think\Cache; @@ -36,7 +35,7 @@ class Addon extends Backend public function index() { $addons = get_addon_list(); - foreach ($addons as $k => &$v) { + foreach ($addons as &$v) { $config = get_addon_config($v['name']); $v['config'] = $config ? 1 : 0; $v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']); @@ -50,7 +49,7 @@ class Addon extends Backend */ public function config($name = null) { - $name = $name ? $name : $this->request->get("name"); + $name = $name ?: $this->request->get("name"); if (!$name) { $this->error(__('Parameter %s can not be empty', 'name')); } @@ -65,7 +64,7 @@ class Addon extends Backend if ($this->request->isPost()) { $params = $this->request->post("row/a", [], 'trim'); if ($params) { - foreach ($config as $k => &$v) { + foreach ($config as &$v) { if (isset($params[$v['name']])) { if ($v['type'] == 'array') { $params[$v['name']] = is_array($params[$v['name']]) ? $params[$v['name']] : (array)json_decode($params[$v['name']], true); @@ -179,7 +178,7 @@ class Addon extends Backend if ($tables) { $prefix = Config::get('database.prefix'); //删除插件关联表 - foreach ($tables as $index => $table) { + foreach ($tables as $table) { //忽略非插件标识的表名 if (!preg_match("/^{$prefix}{$name}/", $table)) { continue; @@ -331,7 +330,7 @@ class Addon extends Backend $filter = (array)json_decode($filter, true); $addons = get_addon_list(); $list = []; - foreach ($addons as $k => $v) { + foreach ($addons as $v) { if ($search && stripos($v['name'], $search) === false && stripos($v['title'], $search) === false && stripos($v['intro'], $search) === false) { continue; } @@ -448,7 +447,7 @@ class Addon extends Backend } $rows = $json['rows'] ?? []; - foreach ($rows as $index => $row) { + foreach ($rows as $row) { if (!isset($row['name'])) { continue; } diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php index df8f8b82e1330ebaff8eedbc48c64624b9dfbf06..4c90906020de46aae439e371c8b04e2a49a4cc01 100644 --- a/application/admin/controller/Ajax.php +++ b/application/admin/controller/Ajax.php @@ -6,7 +6,6 @@ use app\admin\model\AdminLog; use app\common\controller\Backend; use app\common\exception\UploadException; use app\common\library\Upload; -use fast\Random; use think\addons\Service; use think\Cache; use think\Config; @@ -14,7 +13,6 @@ use think\Db; use think\Lang; use think\Loader; use think\Response; -use think\Validate; /** * Ajax异步请求接口 @@ -231,7 +229,6 @@ class Ajax extends Backend $type = $this->request->get('type', ''); $pid = $this->request->get('pid', ''); $where = ['status' => 'normal']; - $categorylist = null; if ($pid || $pid === '0') { $where['pid'] = $pid; } @@ -258,7 +255,6 @@ class Ajax extends Backend $city = $this->request->get('city'); } $where = ['pid' => 0, 'level' => 1]; - $provincelist = null; if ($province !== null) { $where['pid'] = $province; $where['level'] = 2; @@ -277,7 +273,7 @@ class Ajax extends Backend public function icon() { $suffix = $this->request->request("suffix"); - $suffix = $suffix ? $suffix : "FILE"; + $suffix = $suffix ?: "FILE"; $data = build_suffix_image($suffix); $header = ['Content-Type' => 'image/svg+xml']; $offset = 30 * 60 * 60 * 24; // 缓存一个月 diff --git a/application/admin/controller/Category.php b/application/admin/controller/Category.php index c9294ed84ad68d1232f5d930a96d425b94c95b0c..79bc3aad24e47f9fe9c4421f9eddbc1901b8f953 100644 --- a/application/admin/controller/Category.php +++ b/application/admin/controller/Category.php @@ -16,7 +16,7 @@ class Category extends Backend { /** - * @var \app\common\model\Category + * @var CategoryModel */ protected $model = null; protected $categorylist = []; @@ -31,7 +31,7 @@ class Category extends Backend $tree->init(collection($this->model->order('weigh desc,id desc')->select())->toArray(), 'pid'); $this->categorylist = $tree->getTreeList($tree->getTreeArray(0), 'name'); $categorydata = [0 => ['type' => 'all', 'name' => __('None')]]; - foreach ($this->categorylist as $k => $v) { + foreach ($this->categorylist as $v) { $categorydata[$v['id']] = $v; } $typeList = CategoryModel::getTypeList(); @@ -55,7 +55,7 @@ class Category extends Backend //构造父类select列表选项数据 $list = []; - foreach ($this->categorylist as $k => $v) { + foreach ($this->categorylist as $v) { if ($search) { if ($v['type'] == $type && stripos($v['name'], $search) !== false || stripos($v['nickname'], $search) !== false) { if ($type == "all" || $type == null) { @@ -114,7 +114,7 @@ class Category extends Backend $params = $this->preExcludeFields($params); if ($params['pid'] != $row['pid']) { - $childrenIds = Tree::instance()->init(collection(\app\common\model\Category::select())->toArray())->getChildrenIds($row['id'], true); + $childrenIds = Tree::instance()->init(collection(CategoryModel::select())->toArray())->getChildrenIds($row['id'], true); if (in_array($params['pid'], $childrenIds)) { $this->error(__('Can not change the parent to child or itself')); } diff --git a/application/admin/controller/Dashboard.php b/application/admin/controller/Dashboard.php index 2dd2e065d950e6d1ee2bd55df94b5eaae519efcd..6bb2b78a5146caa559de42e6f0a6750db81611e6 100644 --- a/application/admin/controller/Dashboard.php +++ b/application/admin/controller/Dashboard.php @@ -40,7 +40,7 @@ class Dashboard extends Backend $time += 86400; } $userlist = array_fill_keys($column, 0); - foreach ($joinlist as $k => $v) { + foreach ($joinlist as $v) { $userlist[$v['join_date']] = $v['nums']; } @@ -48,7 +48,7 @@ class Dashboard extends Backend $addonList = get_addon_list(); $totalworkingaddon = 0; $totaladdon = count($addonList); - foreach ($addonList as $index => $item) { + foreach ($addonList as $item) { if ($item['state']) { $totalworkingaddon += 1; } diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index dc3509b7bd3a2ebdc361ae689183e0cad94bf3b2..2a494ad6926f4f237c632abc7860f7b72fb1a329 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -109,7 +109,7 @@ class Index extends Backend $this->success(__('Login successful'), $url, ['url' => $url, 'id' => $this->auth->id, 'username' => $username, 'avatar' => $this->auth->avatar]); } else { $msg = $this->auth->getError(); - $msg = $msg ? $msg : __('Username or password is incorrect'); + $msg = $msg ?: __('Username or password is incorrect'); $this->error($msg, $url, ['token' => $this->request->token()]); } } diff --git a/application/admin/controller/auth/Admin.php b/application/admin/controller/auth/Admin.php index 85f8fb4940032515f5098545ef877cfe1c9eed7a..2f5f276bfe1a40876882444e94e3c67ed488530f 100644 --- a/application/admin/controller/auth/Admin.php +++ b/application/admin/controller/auth/Admin.php @@ -42,16 +42,16 @@ class Admin extends Backend $groupdata = []; if ($this->auth->isSuperAdmin()) { $result = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0)); - foreach ($result as $k => $v) { + foreach ($result as $v) { $groupdata[$v['id']] = $v['name']; } } else { $result = []; $groups = $this->auth->getGroups(); - foreach ($groups as $m => $n) { + foreach ($groups as $n) { $childlist = Tree::instance()->getTreeList(Tree::instance()->getTreeArray($n['id'])); $temp = []; - foreach ($childlist as $k => $v) { + foreach ($childlist as $v) { $temp[$v['id']] = $v['name']; } $result[__($n['name'])] = $temp; @@ -83,13 +83,13 @@ class Admin extends Backend ->select(); $adminGroupName = []; - foreach ($authGroupList as $k => $v) { + foreach ($authGroupList as $v) { if (isset($groupName[$v['group_id']])) { $adminGroupName[$v['uid']][$v['group_id']] = $groupName[$v['group_id']]; } } $groups = $this->auth->getGroups(); - foreach ($groups as $m => $n) { + foreach ($groups as $n) { $adminGroupName[$this->auth->id][$n['id']] = $n['name']; } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); @@ -101,8 +101,8 @@ class Admin extends Backend ->order($sort, $order) ->paginate($limit); - foreach ($list as $k => &$v) { - $groups = isset($adminGroupName[$v['id']]) ? $adminGroupName[$v['id']] : []; + foreach ($list as &$v) { + $groups = $adminGroupName[$v['id']] ?? []; $v['groups'] = implode(',', array_keys($groups)); $v['groups_text'] = implode(',', array_values($groups)); } @@ -227,7 +227,7 @@ class Admin extends Backend } $grouplist = $this->auth->getGroups($row['id']); $groupids = []; - foreach ($grouplist as $k => $v) { + foreach ($grouplist as $v) { $groupids[] = $v['id']; } $this->view->assign("row", $row); @@ -243,7 +243,7 @@ class Admin extends Backend if (!$this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post("ids"); if ($ids) { $ids = array_intersect($this->childrenAdminIds, array_filter(explode(',', $ids))); // 避免越权删除管理员 @@ -253,7 +253,7 @@ class Admin extends Backend })->select(); if ($adminList) { $deleteIds = []; - foreach ($adminList as $k => $v) { + foreach ($adminList as $v) { $deleteIds[] = $v->id; } $deleteIds = array_values(array_diff($deleteIds, [$this->auth->id])); diff --git a/application/admin/controller/auth/Adminlog.php b/application/admin/controller/auth/Adminlog.php index 67ec10b1ff85b4c6c5b89e6445a190481bd6e304..28402c3b9354e2e91cf72684ba240d9bf41a0e52 100644 --- a/application/admin/controller/auth/Adminlog.php +++ b/application/admin/controller/auth/Adminlog.php @@ -2,7 +2,6 @@ namespace app\admin\controller\auth; -use app\admin\model\AuthGroup; use app\common\controller\Backend; /** @@ -100,7 +99,7 @@ class Adminlog extends Backend if (!$this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post("ids"); if ($ids) { $isSuperAdmin = $this->auth->isSuperAdmin(); $childrenAdminIds = $this->childrenAdminIds; diff --git a/application/admin/controller/auth/Group.php b/application/admin/controller/auth/Group.php index be4c2c62ba728496e39a2d892144ef85a63d16bd..615451bfa56f837d7f7ee29430cde8c059eb82f8 100644 --- a/application/admin/controller/auth/Group.php +++ b/application/admin/controller/auth/Group.php @@ -3,7 +3,6 @@ namespace app\admin\controller\auth; use app\admin\model\AuthGroup; -use app\admin\model\AuthGroupAccess; use app\common\controller\Backend; use fast\Tree; use think\Db; @@ -19,7 +18,7 @@ class Group extends Backend { /** - * @var \app\admin\model\AuthGroup + * @var AuthGroup */ protected $model = null; //当前登录管理员所有子组别 @@ -59,7 +58,7 @@ class Group extends Backend $groupList = $tree->getTreeList($tree->getTreeArray(0)); } $groupName = []; - foreach ($groupList as $k => $v) { + foreach ($groupList as $v) { $groupName[$v['id']] = $v['name']; } @@ -191,7 +190,7 @@ class Group extends Backend if (!$this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post("ids"); if ($ids) { $ids = explode(',', $ids); $grouplist = $this->auth->getGroups(); @@ -215,7 +214,6 @@ class Group extends Backend $groupone = $this->model->get(['pid' => $v['id']]); if ($groupone) { $ids = array_diff($ids, [$v['id']]); - continue; } } if (!$ids) { @@ -257,7 +255,7 @@ class Group extends Backend $currentGroupModel = $model->get($id); } if (($pid || $parentGroupModel) && (!$id || $currentGroupModel)) { - $id = $id ? $id : null; + $id = $id ?: null; $ruleList = collection(model('AuthRule')->order('weigh', 'desc')->order('id', 'asc')->select())->toArray(); //读取父类角色所有节点列表 $parentRuleList = []; @@ -265,7 +263,7 @@ class Group extends Backend $parentRuleList = $ruleList; } else { $parentRuleIds = explode(',', $parentGroupModel->rules); - foreach ($ruleList as $k => $v) { + foreach ($ruleList as $v) { if (in_array($v['id'], $parentRuleIds)) { $parentRuleList[] = $v; } @@ -289,7 +287,7 @@ class Group extends Backend if (!$id || !in_array($pid, $this->childrenGroupIds) || !in_array($pid, $groupTree->getChildrenIds($id, true))) { $parentRuleList = $ruleTree->getTreeList($ruleTree->getTreeArray(0), 'name'); $hasChildrens = []; - foreach ($parentRuleList as $k => $v) { + foreach ($parentRuleList as $v) { if ($v['haschild']) { $hasChildrens[] = $v['id']; } @@ -306,7 +304,7 @@ class Group extends Backend continue; } $state = array('selected' => in_array($v['id'], $currentRuleIds) && !in_array($v['id'], $hasChildrens)); - $nodeList[] = array('id' => $v['id'], 'parent' => $v['pid'] ? $v['pid'] : '#', 'text' => __($v['title']), 'type' => 'menu', 'state' => $state); + $nodeList[] = array('id' => $v['id'], 'parent' => $v['pid'] ?: '#', 'text' => __($v['title']), 'type' => 'menu', 'state' => $state); } $this->success('', null, $nodeList); } else { diff --git a/application/admin/controller/auth/Rule.php b/application/admin/controller/auth/Rule.php index fc706fa785c9bda37fbef8cf33f5b73232a509a9..16f9eeb2988e806e1700f4c05786ccfcc1cb5142 100644 --- a/application/admin/controller/auth/Rule.php +++ b/application/admin/controller/auth/Rule.php @@ -6,8 +6,6 @@ use app\admin\model\AuthRule; use app\common\controller\Backend; use fast\Tree; use think\Cache; -use think\db\Query; -use think\exception\HttpResponseException; /** * 规则管理 @@ -19,7 +17,7 @@ class Rule extends Backend { /** - * @var \app\admin\model\AuthRule + * @var AuthRule */ protected $model = null; protected $rulelist = []; @@ -34,14 +32,14 @@ class Rule extends Backend $this->model = model('AuthRule'); // 必须将结果集转换为数组 $ruleList = \think\Db::name("auth_rule")->field('type,condition,remark,menutype,extend,pinyin,py,createtime,updatetime', true)->order('weigh DESC,id ASC')->select(); - foreach ($ruleList as $k => &$v) { + foreach ($ruleList as &$v) { $v['title'] = __($v['title']); } unset($v); Tree::instance()->init($ruleList)->icon = ['    ', '    ', '    ']; $this->rulelist = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'title'); $ruledata = [0 => __('None')]; - foreach ($this->rulelist as $k => &$v) { + foreach ($this->rulelist as &$v) { if (!$v['ismenu']) { continue; } @@ -141,10 +139,10 @@ class Rule extends Backend if (!$this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post("ids"); if ($ids) { $delIds = []; - foreach (explode(',', $ids) as $k => $v) { + foreach (explode(',', $ids) as $v) { $delIds = array_merge($delIds, Tree::instance()->getChildrenIds($v, true)); } $delIds = array_unique($delIds); diff --git a/application/admin/controller/general/Attachment.php b/application/admin/controller/general/Attachment.php index 4493921990f8b1a288c258905641e5a6d8f28a62..9e98d9cde6c334f897ff6f1a79b5cfa9556ec92a 100644 --- a/application/admin/controller/general/Attachment.php +++ b/application/admin/controller/general/Attachment.php @@ -66,7 +66,7 @@ class Attachment extends Backend ->paginate($limit); $cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root(true)); - foreach ($list as $k => &$v) { + foreach ($list as &$v) { $v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url']; } unset($v); @@ -111,7 +111,7 @@ class Attachment extends Backend if (!$this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post("ids"); if ($ids) { \think\Hook::add('upload_delete', function ($params) { if ($params['storage'] == 'local') { diff --git a/application/admin/controller/general/Config.php b/application/admin/controller/general/Config.php index 5dac56c91049fa2a303e6895cf829d283601c6cc..347e774a273eae52f4ff5656917cc66f0e67c036 100644 --- a/application/admin/controller/general/Config.php +++ b/application/admin/controller/general/Config.php @@ -5,7 +5,6 @@ namespace app\admin\controller\general; use app\common\controller\Backend; use app\common\library\Email; use app\common\model\Config as ConfigModel; -use think\Cache; use think\Db; use think\Exception; use think\Validate; @@ -20,7 +19,7 @@ class Config extends Backend { /** - * @var \app\common\model\Config + * @var ConfigModel */ protected $model = null; protected $noNeedRight = ['check', 'rulelist', 'selectpage', 'get_fields_list']; @@ -62,7 +61,7 @@ class Config extends Backend $value['content'] = json_decode($value['content'], true); if (in_array($value['name'], ['categorytype', 'configgroup', 'attachmentcategory'])) { $dictValue = (array)json_decode($value['value'], true); - foreach ($dictValue as $index => &$item) { + foreach ($dictValue as &$item) { $item = __($item); } unset($item); @@ -76,8 +75,8 @@ class Config extends Backend $siteList[$v['group']]['list'][] = $value; } $index = 0; - foreach ($siteList as $k => &$v) { - $v['active'] = !$index ? true : false; + foreach ($siteList as &$v) { + $v['active'] = !$index; $index++; } $this->view->assign('siteList', $siteList); @@ -222,7 +221,7 @@ class Config extends Backend $keyValue = $this->request->request("keyValue", ""); $keyValueArr = array_filter(explode(',', $keyValue)); - $regexList = \app\common\model\Config::getRegexList(); + $regexList = ConfigModel::getRegexList(); $list = []; foreach ($regexList as $k => $v) { if ($keyValueArr) { @@ -268,7 +267,7 @@ class Config extends Backend public function selectpage() { $id = $this->request->get("id/d"); - $config = \app\common\model\Config::get($id); + $config = ConfigModel::get($id); if (!$config) { $this->error(__('Invalid parameters')); } diff --git a/application/admin/controller/general/Profile.php b/application/admin/controller/general/Profile.php index aa5fab9aaa3e6d20f464c15a966cfd2abaef44ac..79a8bcc7dcae1a05464e578be025b748ce6ec823 100644 --- a/application/admin/controller/general/Profile.php +++ b/application/admin/controller/general/Profile.php @@ -78,6 +78,5 @@ class Profile extends Backend } $this->error(); } - return; } } diff --git a/application/admin/controller/user/Rule.php b/application/admin/controller/user/Rule.php index 9302dfec245ffe2845ff09f9475862a5e463bc3e..724a2079d862329f283f794e35ab23889e63676b 100644 --- a/application/admin/controller/user/Rule.php +++ b/application/admin/controller/user/Rule.php @@ -27,7 +27,7 @@ class Rule extends Backend $this->view->assign("statusList", $this->model->getStatusList()); // 必须将结果集转换为数组 $ruleList = collection($this->model->order('weigh', 'desc')->select())->toArray(); - foreach ($ruleList as $k => &$v) { + foreach ($ruleList as &$v) { $v['title'] = __($v['title']); $v['remark'] = __($v['remark']); } @@ -35,7 +35,7 @@ class Rule extends Backend Tree::instance()->init($ruleList)->icon = ['    ', '    ', '    ']; $this->rulelist = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'title'); $ruledata = [0 => __('None')]; - foreach ($this->rulelist as $k => &$v) { + foreach ($this->rulelist as &$v) { if (!$v['ismenu']) { continue; } @@ -90,10 +90,10 @@ class Rule extends Backend if (!$this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post("ids"); if ($ids) { $delIds = []; - foreach (explode(',', $ids) as $k => $v) { + foreach (explode(',', $ids) as $v) { $delIds = array_merge($delIds, Tree::instance()->getChildrenIds($v, true)); } $delIds = array_unique($delIds); diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php index 94828e4f7cf28f0220c101ad174aba122a611820..e74a88eec0cad06c480e18b4d92fadce72af3aa9 100644 --- a/application/admin/controller/user/User.php +++ b/application/admin/controller/user/User.php @@ -2,6 +2,7 @@ namespace app\admin\controller\user; +use app\admin\model\UserGroup; use app\common\controller\Backend; use app\common\library\Auth; @@ -44,12 +45,12 @@ class User extends Backend ->where($where) ->order($sort, $order) ->paginate($limit); - foreach ($list as $k => $v) { + foreach ($list as $v) { $v->avatar = $v->avatar ? cdnurl($v->avatar, true) : letter_avatar($v->nickname); $v->hidden(['password', 'salt']); } $rows = $list->items(); - addtion($rows, [['field' => 'group_id', 'display' => 'group_name', 'model' => \app\admin\model\UserGroup::class]]); + addtion($rows, [['field' => 'group_id', 'display' => 'group_name', 'model' => UserGroup::class]]); $result = array("total" => $list->total(), "rows" => $rows); return json($result); @@ -81,7 +82,7 @@ class User extends Backend if (!$row) { $this->error(__('No Results were found')); } - $this->view->assign('groupList', build_select('row[group_id]', \app\admin\model\UserGroup::column('id,name'), $row['group_id'], ['class' => 'form-control selectpicker'])); + $this->view->assign('groupList', build_select('row[group_id]', UserGroup::column('id,name'), $row['group_id'], ['class' => 'form-control selectpicker'])); return parent::edit($ids); } @@ -93,7 +94,7 @@ class User extends Backend if (!$this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post("ids"); $row = $this->model->get($ids); $this->modelValidate = true; if (!$row) { diff --git a/application/admin/library/traits/Backend.php b/application/admin/library/traits/Backend.php index c8f0119e9b8bd860189a8cf75039f63e66579ae3..5de2deffc5c593890b8caffd41a809b1fc74b656 100755 --- a/application/admin/library/traits/Backend.php +++ b/application/admin/library/traits/Backend.php @@ -521,7 +521,7 @@ trait Backend $database = \think\Config::get('database.database'); $fieldArr = []; $list = db()->query("SELECT COLUMN_NAME,COLUMN_COMMENT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ? AND TABLE_SCHEMA = ?", [$table, $database]); - foreach ($list as $k => $v) { + foreach ($list as $v) { if ($importHeadType == 'comment') { $v['COLUMN_COMMENT'] = explode(':', $v['COLUMN_COMMENT'])[0]; //字段备注有:时截取 $fieldArr[$v['COLUMN_COMMENT']] = $v['COLUMN_NAME']; @@ -575,7 +575,7 @@ trait Backend try { //是否包含admin_id字段 $has_admin_id = false; - foreach ($fieldArr as $name => $key) { + foreach ($fieldArr as $key) { if ($key == 'admin_id') { $has_admin_id = true; break;