From 69f3ae12fde794e1a0fd322d3153813b0aafd9d5 Mon Sep 17 00:00:00 2001 From: liapples Date: Mon, 6 Sep 2021 18:35:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AB=9E=E6=A0=87=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E5=8F=91=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('发起竞标'); From 1f011b88f9e73469787c4019cb753ccfd161a44b Mon Sep 17 00:00:00 2001 From: liapples Date: Mon, 6 Sep 2021 18:40:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index b130397..e952777 100644 --- a/routes/web.php +++ b/routes/web.php @@ -14,5 +14,5 @@ use Illuminate\Support\Facades\Route; */ Route::get('/', function () { - return view('welcome'); + return 'welcome'; });