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('产品不存在或已下架');