From 0f6c7991c16c685ecd2b985ed4c88afd1e25d81e Mon Sep 17 00:00:00 2001 From: ASUS <515617283@qq.com> Date: Tue, 14 Apr 2026 15:54:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=81=E5=BA=93=E5=AD=98=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/webman/gateway/Events.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/webman/gateway/Events.php b/plugin/webman/gateway/Events.php index 3e0c074..d348883 100644 --- a/plugin/webman/gateway/Events.php +++ b/plugin/webman/gateway/Events.php @@ -258,6 +258,7 @@ class Events ->order('cons.stock_number', 'asc') ->select()->toArray(); if(!empty($tb_prod_cons[0])) { + print_r($tb_prod_cons); // 如果是编辑,拿到已有数量 if($message['operate_type'] == 'edit' && !empty($message['id'])) { $data = Db::query(" @@ -265,12 +266,11 @@ class Events `id`={$message['id']}"); if($data) { + print_r('有库存'); // 如果编辑数量 小于已有数量并且大于库存数量 直接改成库存数量 if($tb_prod_cons[0]['current_quantity'] < $data[0]['number']) { $message['number'] = $tb_prod_cons[0]['current_quantity']; - } - if($tb_prod_cons[0]['current_quantity'] <= 0) { - $message['number'] = 0; + print_r('修改后的..' . $message['number']); } } }