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