|
|
|
@ -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,agent_product_id,name,date,stock,original_price,price']) |
|
|
|
$agent_product = AgentProduct::with(['coupon:tag,agent_product_id', 'product:id,type,extends', 'spec.productSpec:id,name,date']) |
|
|
|
->whereDoesntHave('agentProductItem', function ($query) { |
|
|
|
return $query->whereHas('product', function ($query) { |
|
|
|
return $query->where('stock', '<=', 0)->orWhere('status', '<>', ProductStatus::ON_SALE); |
|
|
|
|