|
|
|
@ -17,14 +17,7 @@ class TestController |
|
|
|
{ |
|
|
|
public function index() |
|
|
|
{ |
|
|
|
dd(AgentProduct::withoutGlobalScope('orderById') |
|
|
|
->whereDoesntHave('agentProductItem', function ($query) { |
|
|
|
return $query->whereHas('product', function ($query) { |
|
|
|
return $query->where('stock', '<=', 0)->orWhere('status', '<>', ProductStatus::ON_SALE); |
|
|
|
}); |
|
|
|
}) |
|
|
|
->where('stock', '>', 0)->where(['agent_id' => 10, 'status' => ProductStatus::ON_SALE]) |
|
|
|
->select('id', 'sale', 'product_id', 'price', 'original_price', 'title', 'pictures')->withTrashed()->count()); |
|
|
|
dd(AgentProduct::where('agent_id', 10)->withTrashed()->count()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|