From 3399128ca019c5b99b190b2508304799c2604cc3 Mon Sep 17 00:00:00 2001 From: liapples Date: Tue, 28 Sep 2021 21:37:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/TestController.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/Http/Controllers/Api/TestController.php b/app/Http/Controllers/Api/TestController.php index 32adc26..dbd6330 100644 --- a/app/Http/Controllers/Api/TestController.php +++ b/app/Http/Controllers/Api/TestController.php @@ -17,14 +17,7 @@ class TestController { public function index() { - dd(AgentProduct::withoutGlobalScope('orderById') - ->whereDoesntHave('agentProductItem', function ($query) { - return $query->whereHas('product', function ($query) { - return $query->where('stock', '<=', 0)->orWhere('status', '<>', ProductStatus::ON_SALE); - }); - }) - ->where('stock', '>', 0)->where(['agent_id' => 10, 'status' => ProductStatus::ON_SALE]) - ->select('id', 'sale', 'product_id', 'price', 'original_price', 'title', 'pictures')->withTrashed()->count()); + dd(AgentProduct::where('agent_id', 10)->withTrashed()->count()); } /**