diff --git a/app/Http/Controllers/Api/AgentProductController.php b/app/Http/Controllers/Api/AgentProductController.php index 3437542..21ce1b6 100644 --- a/app/Http/Controllers/Api/AgentProductController.php +++ b/app/Http/Controllers/Api/AgentProductController.php @@ -60,9 +60,9 @@ class AgentProductController extends Controller // TODO 优惠券查询待优化 if (AgentProduct::withTrashed()->where('agent_id', $this->agent_id)->count() === 0) { //演示产品用 - $where = ['id' => $id, 'agent_id' => $this->agent_id, 'status' => ProductStatus::ON_SALE]; - } else { $where = ['id' => $id, 'status' => ProductStatus::ON_SALE]; + } else { + $where = ['id' => $id, 'agent_id' => $this->agent_id, 'status' => ProductStatus::ON_SALE]; } $agent_product = AgentProduct::query() ->with(['coupon:tag,agent_product_id'])