diff --git a/plugin/webman/gateway/Events.php b/plugin/webman/gateway/Events.php index 3f25ce7..57198b0 100644 --- a/plugin/webman/gateway/Events.php +++ b/plugin/webman/gateway/Events.php @@ -255,9 +255,8 @@ class Events ->where('r.product_id', $message['product_id']) ->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(); - p($tb_prod_cons); - if($tb_prod_cons['quantity'] > $tb_prod_cons['current_quantity']) { + ->select()->toArray(); + if($tb_prod_cons[0]['quantity'] > $tb_prod_cons[0]['current_quantity']) { $snd_data = [ 'msg' => '此商品库存不足', 'operate_type' => $message['operate_type'],