diff --git a/app/api/logic/GoodsLogic.php b/app/api/logic/GoodsLogic.php index 6a795e6e..ff24d096 100755 --- a/app/api/logic/GoodsLogic.php +++ b/app/api/logic/GoodsLogic.php @@ -1154,30 +1154,30 @@ class GoodsLogic extends Logic } // 如果当前用户参与了抢购的活动(则不允许再次抢购) -// $in_activity = Order::where(['user_id' => $userId, 'order_type' => 4])->where('order_status', '<', 4)->find(); -// -// $goods['activity'] = [ -// 'type' => 4, -// 'type_desc' => '抢购商品', -// 'in_groupbuy_activity' => (bool)$in_activity, -// 'msg' => '您已参与过本次活动,无法再次参与!' -// ]; + $in_activity = Order::where(['user_id' => $userId, 'order_type' => 4])->where('order_status', '<', 4)->find(); + + $goods['activity'] = [ + 'type' => 4, + 'type_desc' => '抢购商品', + 'in_groupbuy_activity' => (bool)$in_activity, + 'msg' => '您已参与过本次活动,无法再次参与!' + ]; // 2024-11-29 更改规则:活动中的每件商品用户都能购买,但是只能买一件 - $in_activity = Order::alias('a') - ->join('order_goods og', 'a.id = og.order_id') - ->where(['a.user_id' => $userId, 'a.order_type' => 4, 'og.goods_id' => $goods['id']]) - ->where('a.order_status', '<', 4) - ->find(); - - if (!empty($in_activity)) { - $goods['activity'] = [ - 'type' => 4, - 'type_desc' => '抢购商品', - 'in_groupbuy_activity' => true, - 'msg' => '您已购买过改商品!' - ]; - } +// $in_activity = Order::alias('a') +// ->join('order_goods og', 'a.id = og.order_id') +// ->where(['a.user_id' => $userId, 'a.order_type' => 4, 'og.goods_id' => $goods['id']]) +// ->where('a.order_status', '<', 4) +// ->find(); +// +// if (!empty($in_activity)) { +// $goods['activity'] = [ +// 'type' => 4, +// 'type_desc' => '抢购商品', +// 'in_groupbuy_activity' => true, +// 'msg' => '您已购买过改商品!' +// ]; +// } return $goods; }