>1.主订单数据 $order = ImsCjdcOrderMain::where('id', $this->order_id)->first()->toArray(); if ($order) { $order['created_at'] = date('Y-m-d H:i:s', $order['created_at']); $order['updated_at'] = $order['updated_at'] ? date('Y-m-d H:i:s', $order['updated_at']) : null; $order['pay_type'] = config('order.pay_type')[$order['pay_type']]; $order['shipping_type'] = config('order.shipping_type')[$order['shipping_type']]; $order['horseman_name'] = LanzuServiceHorseman::getName($order['horseman_id']); //>>2.获取子订单 $orders = ImsCjdcOrder::with('user')->with('store') ->where('order_main_id', $order['id'])->get()->toArray(); if (count($orders)) { foreach ($orders as &$or) { if (substr($or['store']['logo'], 0, 4) != 'http') { $or['store']['logo'] = env('IMG_HOST') . '/' . $or['store']['logo']; } $or['goods'] = LanzuOrderGoods::where('order_id', $or['id'])->get()->toArray(); } } //dd($orders); $orders = json_encode($orders); } //配送距离 //配送费 //拒绝退款理由 //退款总备注原因,单个商品或者单个子订单 Admin::script( << { this.\$message({ type: 'success', message: '操作成功!' }); }).catch(() => { }); } } }); JS ); return view('orderdetail'); } }