public function getListInfo() { $shopID = base64_decode(Input::get('shopID')); $mainOrderID = base64_decode(Input::get('mainOrderID')); $disableChange = DEFAULT_0; $headerShop = AuthController::checkShop($shopID); if (!empty($headerShop)) { $mainOrder = MainOrder::where('wy_main_order_id', $mainOrderID)->where('wy_shop_id', $shopID)->first(array('wy_main_order_id', 'wy_shop_id', 'wy_order_number', 'wy_recv_name', 'wy_recv_addr', 'wy_recv_phone', 'wy_consumption_money', 'wy_actual_money', 'wy_order_state', 'wy_order_state_flow', 'wy_generate_time', 'wy_confirm_time', 'wy_send_time', 'wy_arrive_time', 'wy_reminder_flag', 'wy_reminder_count', 'wy_reminder_time', 'wy_refuse_time', 'wy_cancel_time', 'wy_user_note')); if (!empty($mainOrder)) { $orderStatus = Dictionary::where('wy_dic_id', DIC_ORDER_STATUS)->where('wy_dic_item_id', $mainOrder->wy_order_state)->first(array('wy_dic_value')); $mainOrder->wy_order_state_name = $orderStatus->wy_dic_value; $reminderFlag = Dictionary::where('wy_dic_id', DIC_REMINDER_FLAG)->where('wy_dic_item_id', $mainOrder->wy_reminder_flag)->first(array('wy_dic_value')); $mainOrder->wy_reminder_flag_name = $reminderFlag->wy_dic_value; $subOrders = MainOrder::find($mainOrder->wy_main_order_id)->subOrders()->get(array('wy_goods_id', 'wy_goods_name', 'wy_goods_unit_price', 'wy_goods_amount', 'wy_goods_total_price')); $mainOrder->subOrders = $subOrders; $mainOrder->wy_shop_name = $headerShop->wy_shop_name; $mainOrder->wy_shop_id = base64_encode($mainOrder->wy_shop_id); $mainOrder->wy_main_order_id = base64_encode($mainOrder->wy_main_order_id); //订单流的处理 $orderStatFlows = str_split($mainOrder->wy_order_state_flow); return View::make('admin.template.order.orderdetail', compact('headerShop', 'disableChange', 'mainOrder', 'orderStatFlows')); } else { return View::make('admin.template.order.orderdetail', compact('headerShop', 'disableChange'))->withError(Lang::get('errormessages.-10068')); } } else { return View::make('admin.template.order.orderdetail', compact('disableChange'))->withError(Lang::get('errormessages.-10068')); } }
/** * 打印订单 * * @return Response */ public function getPrint($shop_id, $main_order_id) { $shopID = base64_decode($shop_id); $headerShop = AuthController::checkShop($shopID); $mainOrderID = base64_decode($main_order_id); if (empty($headerShop)) { App::abort(404); } else { $shop = Shop::where('wy_shop_id', $shopID)->first(); $shop->wy_shop_id = base64_encode($shop->wy_shop_id); $mainOrder = MainOrder::where('wy_shop_id', $shopID)->where('wy_main_order_id', $mainOrderID)->first(); $subOrders = MainOrder::find($mainOrder->wy_main_order_id)->subOrders()->get(array('wy_goods_id', 'wy_goods_name', 'wy_goods_unit_price', 'wy_goods_amount', 'wy_goods_total_price')); $goodsTotalAmout = MainOrder::find($mainOrder->wy_main_order_id)->subOrders()->sum('wy_goods_amount'); $mainOrder->goodsTotalAmout = $goodsTotalAmout; $mainOrder->subOrders = $subOrders; $mainOrder->wy_shop_id = base64_encode($mainOrder->wy_shop_id); $mainOrder->wy_main_order_id = base64_encode($mainOrder->wy_main_order_id); return View::make('admin.print.print', compact('mainOrder', 'shop')); } }