From b41cdefa7afe9cd9caf051e6b5a8965899653e32 Mon Sep 17 00:00:00 2001 From: liapples Date: Sun, 26 Sep 2021 10:27:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/AgentProductController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AgentProductController.php b/app/Http/Controllers/Api/AgentProductController.php index 7405f82..dd202ce 100644 --- a/app/Http/Controllers/Api/AgentProductController.php +++ b/app/Http/Controllers/Api/AgentProductController.php @@ -64,7 +64,7 @@ class AgentProductController extends Controller } else { $where = ['id' => $id, 'agent_id' => $this->agent_id, 'status' => ProductStatus::ON_SALE]; } - $agent_product = AgentProduct::with(['coupon:tag,agent_product_id', 'product:id,type,extends', 'spec:id,name,date,stock,original_price,price']) + $agent_product = AgentProduct::with(['coupon:tag,agent_product_id', 'product:id,type,extends', 'spec:id,agent_product_id,name,date,stock,original_price,price']) ->whereDoesntHave('agentProductItem', function ($query) { return $query->whereHas('product', function ($query) { return $query->where('stock', '<=', 0)->orWhere('status', '<>', ProductStatus::ON_SALE);