From 69f3ae12fde794e1a0fd322d3153813b0aafd9d5 Mon Sep 17 00:00:00 2001 From: liapples Date: Mon, 6 Sep 2021 18:35:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E6=A0=87=E5=8F=AA=E8=83=BD=E5=8F=91?= =?UTF-8?q?=E8=B5=B7=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminSupplier/Controllers/DemandBiddingController.php | 6 ++++++ app/AdminSupplier/Controllers/DemandController.php | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/AdminSupplier/Controllers/DemandBiddingController.php b/app/AdminSupplier/Controllers/DemandBiddingController.php index 02078a9..9e16d35 100755 --- a/app/AdminSupplier/Controllers/DemandBiddingController.php +++ b/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(); diff --git a/app/AdminSupplier/Controllers/DemandController.php b/app/AdminSupplier/Controllers/DemandController.php index c97a57d..1c3f342 100755 --- a/app/AdminSupplier/Controllers/DemandController.php +++ b/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('发起竞标');