From d87b174d7c598fc790517a0bee114a5da18cad1c Mon Sep 17 00:00:00 2001 From: liapples Date: Mon, 16 Aug 2021 17:00:51 +0800 Subject: [PATCH] =?UTF-8?q?status=E5=B8=B8=E9=87=8F=E5=80=BC=E7=94=B11?= =?UTF-8?q?=E6=94=B9=E4=B8=BAProductStatus::ON=5FSALE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/AgentProductController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AgentProductController.php b/app/Http/Controllers/Api/AgentProductController.php index d946bc1..80161b4 100644 --- a/app/Http/Controllers/Api/AgentProductController.php +++ b/app/Http/Controllers/Api/AgentProductController.php @@ -1,6 +1,7 @@ with('product:id,title,pictures,know,stock,content') ->with('coupon:tag,agent_product_id') ->with('fav:agent_product_id') - ->firstWhere(['id' => $id, 'agent_id' => $this->agent_id, 'status' => 1]); + ->firstWhere(['id' => $id, 'agent_id' => $this->agent_id, 'status' => ProductStatus::ON_SALE]); if (!$agent_product || !$agent_product->product) { return $this->error('产品不存在或已下架');