From e2e751a41056494d32d2a6817b8d2203ce92a3b8 Mon Sep 17 00:00:00 2001 From: denghy Date: Fri, 4 Jan 2019 09:49:43 +0800 Subject: [PATCH] else --- app/Domains/Company/Http/Controllers/OrderController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Domains/Company/Http/Controllers/OrderController.php b/app/Domains/Company/Http/Controllers/OrderController.php index 52567ded..bbdc2647 100644 --- a/app/Domains/Company/Http/Controllers/OrderController.php +++ b/app/Domains/Company/Http/Controllers/OrderController.php @@ -69,11 +69,12 @@ class OrderController extends Controller $order_at = Carbon::parse($res->last()->order_at); $conditions['starttime'] = $order_at->copy()->startOfMonth()->startOfDay()->format('Y-m-d H:i:s'); $conditions['endtime'] = $order_at->copy()->endOfMonth()->endOfDay()->format('Y-m-d H:i:s'); + } else { + $count = $this->orderService->count($conditions); + $count['starttime'] = $conditions['starttime']; + $count['endtime'] = $conditions['endtime']; } - $count = $this->orderService->count($conditions); - $count['starttime'] = $conditions['starttime']; - $count['endtime'] = $conditions['endtime']; return res(['count' => $count, 'orders' => $res], '订单列表', 201); }