From 0ba1c7b98536fc5f3472dd6e4c6b6a11ab565089 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Mon, 11 Apr 2022 14:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A0=8D=E4=BB=B7=E6=B7=BB=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=8D=95=E5=8F=AA=E8=83=BD=E7=A0=8D=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/BargainService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Services/BargainService.php b/app/Services/BargainService.php index 4dbcc562..ec62fc6d 100644 --- a/app/Services/BargainService.php +++ b/app/Services/BargainService.php @@ -78,6 +78,10 @@ class BargainService throw new BizException('当前砍价已结束,无法再砍'); } + //如果已经砍过了,不能再砍了 + if ($order->logs()->where('user_id', $user->id)->exists()) { + throw new BizException('您已砍价'); + } //执行砍价动作; //计算第几次砍价,并获得当前砍价金额 @@ -99,8 +103,4 @@ class BargainService return $order; } - - public function createMallOrder(BargainOrder $order) - { - } }