From c5fb6f94091a2f8faf0c55f2eaaaf338cbd3f486 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Fri, 4 Sep 2020 10:09:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catch/permissions/controller/User.php | 4 +++- catch/system/model/Attachments.php | 1 + catch/system/model/search/AttachmentsSearch.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/catch/permissions/controller/User.php b/catch/permissions/controller/User.php index 77fec8a..cf0d1a2 100644 --- a/catch/permissions/controller/User.php +++ b/catch/permissions/controller/User.php @@ -86,7 +86,9 @@ class User extends CatchController $this->user->attachRoles($request->param('roles')); - $this->user->attachJobs($request->param('jobs')); + if ($request->param('jobs')) { + $this->user->attachJobs($request->param('jobs')); + } return CatchResponse::success('', '添加成功'); } diff --git a/catch/system/model/Attachments.php b/catch/system/model/Attachments.php index 104ba31..88cbd31 100644 --- a/catch/system/model/Attachments.php +++ b/catch/system/model/Attachments.php @@ -30,6 +30,7 @@ class Attachments extends CatchModel { return $this->order('id', 'desc') ->catchSearch() + ->catchOrder() ->paginate(); } diff --git a/catch/system/model/search/AttachmentsSearch.php b/catch/system/model/search/AttachmentsSearch.php index b1f0400..d6c32d7 100644 --- a/catch/system/model/search/AttachmentsSearch.php +++ b/catch/system/model/search/AttachmentsSearch.php @@ -22,7 +22,7 @@ trait AttachmentsSearch return $query->where('mime_type', $value); } - public function searchDriver($query, $value, $data) + public function searchDriverAttr($query, $value, $data) { return $query->where('driver', $value); }