From 1df6789afc83b35f5941c6fdd6e13ceade75eb08 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Fri, 29 Nov 2024 14:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=B4=BB=E5=8A=A8=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/GoodsLogic.php | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) 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; }