From 22b18e2dacd6bb6eaa5acbf859b8d2ea1351fa3c Mon Sep 17 00:00:00 2001 From: wushumin Date: Fri, 5 Jun 2026 17:45:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=8B=AC=E7=AB=8B=E6=90=9C=E7=B4=A2=E5=BF=AB?= =?UTF-8?q?=E9=80=92=E5=8D=95=E5=8F=B7=E5=92=8C=E7=94=A8=E6=88=B7=E7=94=B5?= =?UTF-8?q?=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-web/src/pages/orders/index.vue | 6 +++++ .../app/controller/admin/OrdersController.php | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/admin-web/src/pages/orders/index.vue b/admin-web/src/pages/orders/index.vue index 887a7cc..5c44b49 100644 --- a/admin-web/src/pages/orders/index.vue +++ b/admin-web/src/pages/orders/index.vue @@ -42,6 +42,8 @@ const manualForm = ref(createManualOrderForm()); const manualAddressRecognitionText = ref(""); const keyword = ref(""); +const trackingNo = ref(""); +const userMobile = ref(""); const serviceProvider = ref(""); const status = ref(""); const sourceChannel = ref(""); @@ -201,6 +203,8 @@ async function fetchOrders() { try { const response = await adminApi.getOrders({ keyword: keyword.value, + tracking_no: trackingNo.value, + user_mobile: userMobile.value, service_provider: serviceProvider.value, status: status.value, source_channel: sourceChannel.value, @@ -531,6 +535,8 @@ onMounted(fetchOrders);
+ + diff --git a/server-api/app/controller/admin/OrdersController.php b/server-api/app/controller/admin/OrdersController.php index b470910..0a11a31 100644 --- a/server-api/app/controller/admin/OrdersController.php +++ b/server-api/app/controller/admin/OrdersController.php @@ -18,6 +18,8 @@ class OrdersController public function index(Request $request) { $keyword = trim((string)$request->input('keyword', '')); + $trackingNo = trim((string)$request->input('tracking_no', '')); + $userMobile = trim((string)$request->input('user_mobile', '')); $status = trim((string)$request->input('status', '')); $serviceProvider = trim((string)$request->input('service_provider', '')); $sourceChannel = $this->normalizeOrderSourceChannel((string)$request->input('source_channel', '')); @@ -62,6 +64,30 @@ class OrdersController }); } + if ($trackingNo !== '') { + $query->whereRaw( + "EXISTS (SELECT 1 FROM order_logistics ol WHERE ol.order_id = o.id AND ol.logistics_type IN ('send_to_center', 'return_to_user') AND ol.tracking_no LIKE :tracking_no)", + [ + 'tracking_no' => "%{$trackingNo}%", + ] + ); + } + + if ($userMobile !== '') { + $query->leftJoin('users u', 'u.id = o.user_id') + ->leftJoin('order_return_addresses ra', 'ra.order_id = o.id'); + + $query->where(function ($builder) use ($userMobile) { + $builder->whereRaw( + '(u.mobile LIKE :user_mobile OR ra.mobile LIKE :return_mobile)', + [ + 'user_mobile' => "%{$userMobile}%", + 'return_mobile' => "%{$userMobile}%", + ] + ); + }); + } + $warehouseStatusFilters = [ 'warehouse_active', 'warehouse_pending_inbound',