From a7e664430bd1916943dd29ff256199f50e9015e1 Mon Sep 17 00:00:00 2001 From: jianghanbo Date: Tue, 3 Dec 2024 18:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=AE=A2=E5=8D=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/app/admin/controller/AdminController.php | 7 +++++-- service/app/admin/controller/OrderController.php | 15 +++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/service/app/admin/controller/AdminController.php b/service/app/admin/controller/AdminController.php index 86cef063..1f470efe 100644 --- a/service/app/admin/controller/AdminController.php +++ b/service/app/admin/controller/AdminController.php @@ -30,9 +30,12 @@ class AdminController extends base //$routeType = self::ROUTE_LISTS[mb_substr($typeDesc, 0, 2)] ?? 10; //$query->where('route_type', $routeType); } + try { + if ($request->admin->is_franchisee == 1) { + $query->where('pid', $request->admin->id); + } + } catch (\Exception $exception) { - if ($request->admin->is_franchisee == 1) { - $query->where('pid', $request->admin->id); } $list = $query->paginate($request->get('limit',10)); diff --git a/service/app/admin/controller/OrderController.php b/service/app/admin/controller/OrderController.php index f37035ea..6c2d3cc2 100644 --- a/service/app/admin/controller/OrderController.php +++ b/service/app/admin/controller/OrderController.php @@ -100,13 +100,16 @@ class OrderController extends base $zhubo_id = Admins::where('username', $zhubo)->value('id'); $query->where('zhubo', $zhubo_id); } + try { + $admin = $request->get('admin'); + if ($request->admin->is_franchisee == 1) { + $query->whereRaw(sprintf('admin_id in (select id from admins where pid = "%s")', $request->admin->id)); + } elseif($admin){ + $admin_id = Admins::where('username', $admin)->value('id'); + $query->where('admin_id', $admin_id); + } + } catch (\Exception $exception) { - $admin = $request->get('admin'); - if ($request->admin->is_franchisee == 1) { - $query->whereRaw(sprintf('admin_id in (select id from admins where pid = "%s")', $request->admin->id)); - } elseif($admin){ - $admin_id = Admins::where('username', $admin)->value('id'); - $query->where('admin_id', $admin_id); } $excel = $request->get('excel');