From f6960144b4b2b5ce600984d581b5697298d38987 Mon Sep 17 00:00:00 2001 From: liapples Date: Wed, 1 Sep 2021 09:41:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/TestController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/TestController.php b/app/Http/Controllers/Api/TestController.php index 4e4d5ed..6cd7188 100644 --- a/app/Http/Controllers/Api/TestController.php +++ b/app/Http/Controllers/Api/TestController.php @@ -16,7 +16,7 @@ class TestController public function index() { //test - $ids = Order::all(['id AS order_id', 'product_ids', 'agent_id', 'agent_product_id']); + $ids = Order::orderBy('id')->get(['id AS order_id', 'product_ids', 'agent_id', 'agent_product_id']); foreach ($ids as $v) { $item = Product::query()->whereIn('id', explode(',', $v['product_ids'])) ->orderBy('id')->get(['id AS product_id', 'supplier_id'])->toArray();