diff --git a/plugin/webman/gateway/Events.php b/plugin/webman/gateway/Events.php index 5784b74..84fd469 100644 --- a/plugin/webman/gateway/Events.php +++ b/plugin/webman/gateway/Events.php @@ -237,9 +237,11 @@ class Events base::gateway_query('sendToUid', [$s_id, json_encode($snd_data)]); return; } - $product = Db::query(" - SELECT * FROM `tb_product` WHERE - `id`={$message['product_id']}"); + if(!empty($message['product_id'])) { + $product = Db::query(" + SELECT * FROM `tb_product` WHERE + `id`={$message['product_id']}"); + } // 如果是新增或者编辑,查询库存够不够 if ( (!empty($message['operate_type']) && ($message['operate_type'] == 'add' || $message['operate_type'] == 'edit')) &&