From 3a3f88380502d75d5e889f8bbf195fde54a2eeeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=88=90=7C13142600015?= Date: Thu, 6 Apr 2023 13:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'src/Grid/Displayers/Actio?= =?UTF-8?q?ns.php'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 回收站删除问题,url参数格式错误 --- src/Grid/Displayers/Actions.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Grid/Displayers/Actions.php b/src/Grid/Displayers/Actions.php index 0c0e034..f1e2ab3 100644 --- a/src/Grid/Displayers/Actions.php +++ b/src/Grid/Displayers/Actions.php @@ -144,12 +144,12 @@ class Actions extends AbstractDisplayer $actions = $this->prepends; foreach ($this->actions as $action) { - $method = 'render'.ucfirst($action); + $method = 'render' . ucfirst($action); array_push($actions, $this->{$method}()); } $actions = array_merge($actions, $this->appends); - $actions_str=implode('', $actions); + $actions_str = implode('', $actions); return << $actions_str @@ -193,6 +193,7 @@ EOT; $resume_checkout = ""; return $resume_checkout; } + /** * Render delete action. * @@ -201,21 +202,22 @@ EOT; protected function renderDelete() { $title = ''; - $url_pams = ''; - if(strstr($this->getResource(),'firm/company') && !(strstr($this->getResource(),'firm/companyimg'))&& !(strstr($this->getResource(),'firm/companysetmeal'))) { + $url_pams = []; + if (strstr($this->getResource(), 'firm/company') && !(strstr($this->getResource(), 'firm/companyimg')) && !(strstr($this->getResource(), 'firm/companysetmeal'))) { $deleteConfirm = trans('admin.delete_company_confirm'); - }elseif (strstr($this->getResource(),'personal/members')) { + } elseif (strstr($this->getResource(), 'personal/members')) { $deleteConfirm = trans('admin.delete_person_confirm'); - } elseif (strstr($this->getResource(),'recycle/index')){ - $scope = array_get(request()->all(),'scope',1); - $url_pams='?scope='.$scope; + } elseif (strstr($this->getResource(), 'recycle/index')) { + $scope = array_get(request()->all(), 'scope', 1); + $url_pams['scope'] = $scope; $deleteConfirm = trans('admin.delete_confirm'); - }elseif (strstr($this->getResource(),'personal/resume')){ + } elseif (strstr($this->getResource(), 'personal/resume')) { $deleteConfirm = trans('admin.delete_confirm'); $title = $this->resume_checkout(); } else { $deleteConfirm = trans('admin.delete_confirm'); } + $url_pams = empty(http_build_query($url_pams)) ? '' : '&' . http_build_query($url_pams); $confirm = trans('admin.confirm'); $cancel = trans('admin.cancel'); $script = <<