判断用户是否参与了抢购商品的活动

This commit is contained in:
wangxiaowei 2024-09-30 16:09:40 +08:00
parent 3867fd19fb
commit e729e758ac

@ -120,7 +120,7 @@ class OrderLogic extends Logic
Db::startTrans();
try {
if ($post['order_type'] == 4) {
$in_activity = Order::where(['user_id' => $userId, 'order_type' => 4])->where('order_status', '<', 4)->find();
$in_activity = Order::where(['user_id' => $post['user_id'], 'order_type' => 4])->where('order_status', '<', 4)->find();
if ($in_activity) {
throw new Exception('每位用户只能限抢一件商品');
}