request->isAjax()) { $get = $this->request->get(); return JsonServer::success('', OrderLogic::statistics($get)); } $data = OrderLogic::statistics(); // 订单状态 $order_status = OrderModel::getOrderStatus(true); $order_status = OrderLogic::getStat($order_status); //拼装数量统计 // 订单类型 $order_type = OrderModel::getOrderType(true); // 订单来源 $order_source = Client_::getClient(true); // 支付方式 $pay_way = PayEnum::getPayWay(true); // 配送方式 $delivery_type = OrderModel::getDeliveryType(true); $all = OrderLogic::getAll(); return view('', [ 'all' => $all, 'statistics' => $data, 'order_status' => $order_status, 'order_type' => $order_type, 'order_source' => $order_source, 'pay_way' => $pay_way, 'delivery_type' => $delivery_type ]); } /** * @notes 订单详情 * @return \think\response\View * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @author suny * @date 2021/7/13 7:07 下午 */ public function detail() { $id = $this->request->get('id'); $detail = OrderLogic::getDetail($id); $order_log = OrderLog::getOrderLog($id); return view('', [ 'detail' => $detail, 'logs' => $order_log ]); } /** * @notes 物流信息 * @return \think\response\View * @author suny * @date 2021/7/13 7:07 下午 */ public function express() { $id = $this->request->get('id'); $detail = OrderLogic::getDetail($id); $detail['shipping'] = OrderLogic::shippingInfo($detail['id']); return view('', [ 'detail' => $detail ]); } /** * @notes 导出Excel * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/4/24 10:20 */ public function export() { $params = $this->request->get(); $result = OrderLogic::statistics($params, true); if(false === $result) { return JsonServer::error(OrderLogic::getError() ?: '导出失败'); } return JsonServer::success('', $result); } }