diff --git a/plugin/webman/gateway/Events.php b/plugin/webman/gateway/Events.php index 57198b0..cff2fed 100644 --- a/plugin/webman/gateway/Events.php +++ b/plugin/webman/gateway/Events.php @@ -256,7 +256,7 @@ class Events ->fieldRaw('r.cons_info_id AS consId, SUM(r.surplus_stock * ' . $message['number'] . ') AS quantity, cons.stock_number AS current_quantity') ->group('r.cons_info_id') ->select()->toArray(); - if($tb_prod_cons[0]['quantity'] > $tb_prod_cons[0]['current_quantity']) { + if(!empty($tb_prod_cons[0]) && $tb_prod_cons[0]['quantity'] > $tb_prod_cons[0]['current_quantity']) { $snd_data = [ 'msg' => '此商品库存不足', 'operate_type' => $message['operate_type'],