|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace App\Providers; |
|
|
|
|
|
|
|
use App\Common\AgentType; |
|
|
|
use App\Common\ProductStatus; |
|
|
|
use App\Models\AgentProduct; |
|
|
|
use App\Models\AgentProductItem; |
|
|
|
@ -42,6 +43,9 @@ class ProductServiceProvider extends ServiceProvider |
|
|
|
$agentIds = AgentProductItem::query() |
|
|
|
->withoutGlobalScope('orderById') |
|
|
|
->where('supplier_id', $product->supplier_id) |
|
|
|
->whereHas('agent',function($query) { |
|
|
|
$query->where('type','!=',AgentType::CLUSTER); |
|
|
|
}) |
|
|
|
->distinct() |
|
|
|
->pluck('agent_id'); |
|
|
|
foreach ($agentIds as $v) { |
|
|
|
|