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']); } } }