Browse Source

竞标只能发起一次

develop
李可松 4 years ago
parent
commit
69f3ae12fd
  1. 6
      app/AdminSupplier/Controllers/DemandBiddingController.php
  2. 5
      app/AdminSupplier/Controllers/DemandController.php

6
app/AdminSupplier/Controllers/DemandBiddingController.php

@ -107,6 +107,12 @@ class DemandBiddingController extends AdminController
$form->disableDeleteButton();
$form->disableViewButton();
$form->disableViewCheck();
$demand_id = request('demand_id');
if ($demand_id && \App\Models\DemandBidding::find($demand_id)) {
Admin::exit('你已经竞标过了,无需重复参加');
}
$form->display('id')->disable();
if(request('is_bidding',0)) {
$form->textarea('comment')->disable();

5
app/AdminSupplier/Controllers/DemandController.php

@ -33,7 +33,7 @@ class DemandController extends AdminController
*/
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)) {
$grid->model()->where(['publisher_id' => Admin::user()->id,'publisher_type' => DemandTraits::$col[1]]);
}
@ -72,7 +72,8 @@ class DemandController extends AdminController
}else{
$grid->column('bidding','竞标')
->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) {
$column->append('<a class="btn btn-sm btn-primary" href="'.admin_url('/demand_bidding/create?demand_id='.$this->id).'">发起竞标</a>');

Loading…
Cancel
Save