From 4c09bdee161b8115d8661ccb62f3e71c2f23b6a3 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Fri, 26 Jan 2024 13:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B4=BB=E5=8A=A8=E5=95=86?= =?UTF-8?q?=E5=93=81=E9=99=90=E8=B4=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/StoreActivityDao.php | 4 ++++ app/controller/api/Open.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/common/dao/store/StoreActivityDao.php b/app/common/dao/store/StoreActivityDao.php index 4f007afb..8b311a7d 100755 --- a/app/common/dao/store/StoreActivityDao.php +++ b/app/common/dao/store/StoreActivityDao.php @@ -143,6 +143,10 @@ class StoreActivityDao extends BaseDao { $orderProductIds = array_column($order->orderProduct->toArray(), 'product_id'); $productIds = CloudProduct::whereIn('product_id', $orderProductIds)->where('activity_id', $activityId)->column('product_id'); + $find = StoreActivityOrderProduct::where('user_id', $order['uid'])->where('status', 1)->find(); + if ($find && $activityId == 2) { + throw new ValidateException('活动商品限购1个'); + } foreach ($productIds as $productId) { $model = new StoreActivityOrderProduct(); $model->user_id = $order['uid']; diff --git a/app/controller/api/Open.php b/app/controller/api/Open.php index e2f7a37e..8d05d96b 100755 --- a/app/controller/api/Open.php +++ b/app/controller/api/Open.php @@ -20,10 +20,10 @@ class Open extends BaseController { $timestamp = $this->request->post('timestamp'); $data = $this->request->post('data'); - Log::error('供销平台佣金回调:' . $data); $aes = new \AES(); $iv = !empty($timestamp) ? $aes->buildIv($timestamp) : ''; $decrypted = $aes->decrypt($data, $iv); + Log::error('供销平台佣金回调:' . var_export($decrypted, true)); if (!empty($decrypted)) { $storeConsumptionUserDao = new CommissionDao(); // "惠农供销,谱写数字新篇章"活动首单分润