diff --git a/app/api/logic/GoodsLogic.php b/app/api/logic/GoodsLogic.php index 2853e17d..6a9e2797 100755 --- a/app/api/logic/GoodsLogic.php +++ b/app/api/logic/GoodsLogic.php @@ -1115,7 +1115,7 @@ class GoodsLogic extends Logic } // 如果当前用户参与了抢购的活动(则不允许再次抢购) - $in_activity = Order::where('user_id', $userId)->where('order_status', '<', 4)->find(); + $in_activity = Order::where(['user_id' => $userId, 'order_type' => 4])->where('order_status', '<', 4)->find(); $goods['activity'] = [ 'type' => 4, diff --git a/app/api/logic/OrderLogic.php b/app/api/logic/OrderLogic.php index 507220d8..c135e76d 100755 --- a/app/api/logic/OrderLogic.php +++ b/app/api/logic/OrderLogic.php @@ -120,7 +120,7 @@ class OrderLogic extends Logic Db::startTrans(); try { if ($post['order_type'] == 4) { - $in_activity = Order::where('user_id', $post['user_id'])->where('order_status', '<', 4)->find(); + $in_activity = Order::where(['user_id' => $userId, 'order_type' => 4])->where('order_status', '<', 4)->find(); if ($in_activity) { throw new Exception('每位用户只能限抢一件商品'); }