|
|
@ -33,7 +33,7 @@ class DemandController extends AdminController |
|
|
*/ |
|
|
*/ |
|
|
protected function grid() |
|
|
protected function grid() |
|
|
{ |
|
|
{ |
|
|
return Grid::make(new Demand(['publisher','biddingUser']), function (Grid $grid) { |
|
|
|
|
|
|
|
|
return Grid::make(new Demand(['publisher','biddingUser', 'bidding']), function (Grid $grid) { |
|
|
if (\request('self',0)) { |
|
|
if (\request('self',0)) { |
|
|
$grid->model()->where(['publisher_id' => Admin::user()->id,'publisher_type' => DemandTraits::$col[1]]); |
|
|
$grid->model()->where(['publisher_id' => Admin::user()->id,'publisher_type' => DemandTraits::$col[1]]); |
|
|
} |
|
|
} |
|
|
@ -72,7 +72,8 @@ class DemandController extends AdminController |
|
|
}else{ |
|
|
}else{ |
|
|
$grid->column('bidding','竞标') |
|
|
$grid->column('bidding','竞标') |
|
|
->if(function (){ |
|
|
->if(function (){ |
|
|
return $this->state == 1 && $this->bidding_user_type == DemandTraits::$col[1]; |
|
|
|
|
|
|
|
|
// $this->bidding 表示参加过竞标后不再显示
|
|
|
|
|
|
return $this->state == 1 && $this->bidding_user_type == DemandTraits::$col[1] && $this->bidding; |
|
|
}) |
|
|
}) |
|
|
->then(function (Grid\Column $column) { |
|
|
->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>'); |
|
|
|