| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -3,9 +3,7 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					namespace App\AdminSupplier\Controllers; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use App\AdminSupplier\Lazys\DemandBiddingLazys; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use App\Models\AgentProduct; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use App\Models\DemandProduct; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use App\Models\Product; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use App\Traits\ResponseHelper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use App\AdminAgent\Repositories\Demand; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use App\Models\DemandBidding; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -15,12 +13,6 @@ use Dcat\Admin\Grid; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use Dcat\Admin\Show; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use Dcat\Admin\Http\Controllers\AdminController; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use App\Traits\DemandTraits; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use Illuminate\Database\Eloquent\Model; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use Illuminate\Http\Request; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use Illuminate\Support\Arr; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use Illuminate\Support\Facades\DB; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use Illuminate\Support\Facades\Log; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					use Illuminate\Support\Facades\URL; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					class DemandController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					{ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -70,14 +62,16 @@ class DemandController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											return DemandBiddingLazys::make(['demand_id' => $this->id]); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}else{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$grid->column('bidding','竞标') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										->if(function (){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$grid->column('bidding', '竞标') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										->if(function () { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											// $this->bidding 表示参加过竞标后不再显示
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											return $this->state == 1 && $this->bidding_user_type == DemandTraits::$col[1] && $this->bidding; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										}) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										->then(function (Grid\Column $column) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											$column->append('<a class="btn btn-sm btn-primary" href="'.admin_url('/demand_bidding/create?demand_id='.$this->id).'">发起竞标</a>'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											$column->append('<a class="btn btn-sm btn-primary" href="' . admin_url('/demand_bidding/create?demand_id=' . $this->id) . '">发起竞标</a>'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										}) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										->else() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										->display(''); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $grid->column('created_at')->sortable(); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |