diff --git a/app/common/dao/store/StoreActivityDao.php b/app/common/dao/store/StoreActivityDao.php index 0c6b973e..3f7615d8 100755 --- a/app/common/dao/store/StoreActivityDao.php +++ b/app/common/dao/store/StoreActivityDao.php @@ -23,6 +23,7 @@ use app\common\repositories\store\product\SpuRepository; use think\db\Query; use think\exception\ValidateException; use think\facade\Db; +use think\facade\Log; /** * @@ -147,18 +148,19 @@ class StoreActivityDao extends BaseDao if (empty($productIds)) { return; } - $find = StoreActivityOrderProduct::where('user_id', $order['uid'])->where('status', 1)->find(); + // $find = StoreActivityOrderProduct::where('user_id', $order['uid'])->where('status', 1)->find(); foreach ($productIds as $productId) { - if (!empty($find['product_id']) && $find['product_id'] == $productId && $activityId == 2) { - throw new ValidateException('活动商品限购1个'); - } + // if (!empty($find['product_id']) && $find['product_id'] == $productId && $activityId == 2) { + // throw new ValidateException('活动商品限购1个'); + // } $model = new StoreActivityOrderProduct(); $model->user_id = $order['uid']; $model->activity_id = $activityId; $model->product_id = $productId; $model->number = 1; if (!$model->save()) { - throw new ValidateException('活动商品数据保存失败'); + Log::error('活动商品数据保存失败productId'.$productId); + // throw new ValidateException('活动商品数据保存失败'); } } } diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index bf82f02d..34bd645e 100755 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -164,8 +164,7 @@ class StoreOrderRepository extends BaseRepository Db::commit(); } catch (Exception $e) { Db::rollback(); - halt($e); - throw new ValidateException('余额支付失败'); + throw new ValidateException('余额支付失败'.$e->getMessage()); } return app('json')->status('success', '余额支付成功', ['order_id' => $groupOrder['group_order_id']]);