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) - { - } }