user_id; foreach ($form->group_order_goods as $item) { $mch_id = $item['mch_order_info']['mch_id']; $mall_id = $item['mch_order_info']['mall_id']; $goods = $item['goods']; $goods_num = array_column($goods,'num','goods_id'); $goods_ids = array_keys($goods); $attrs = []; foreach ($goods_ids as $goods_id) { foreach ($goods[$goods_id]['goods_details'] as $attr) { $attrs[$attr['goods_attr_id']] = $attr['num']; } } $order_check = GlobalInvoke::exec(GlobalInvoke::ORDERC_CHECK, $mall_id, ['mall_id' => $mall_id,'pay_money' => $item['mch_order_info']['total_pay_price'] ?? 0,'mch_id' => $mch_id,'goods_ids' => $goods_ids, 'user_id' => $user_id,'goods_num' => $goods_num, 'attrs' => $attrs, 'address_id' => $form->address_id]); if($order_check && $order_check['status'] === false){ //下单检测失败 $msg = $order_check['msg'] ?? '下单检测失败'; $msg = $msg ? $msg : '下单检测失败'; throw new Exception($msg); } if (!empty($order_check['checks'])) { foreach ($order_check['checks'] as $cKey => $cVal) { if (!empty($cVal['extra'])) { foreach ($cVal['extra'] as $eKey => $eVal) { foreach ($eVal as $exKey => $exVal) { $form->process_extra_data[$exKey][$eKey][] = $exVal; } } } } } } } }