data["active_test"] = "active"; } public function method(Request $request, $method) { try { return call_user_func([$this, $method], $request); }catch (\BadMethodCallException $e){ dd("方法不存在"); } } public function test(Request $request) { $s = new AuthorityService(); $s->removeAdminAuth(); dd(1); Log::error(json_encode($request->header(),JSON_UNESCAPED_UNICODE)); return json_encode($request->header(),JSON_UNESCAPED_UNICODE); } private function paramDefault($waybill):array { $update = []; if (!$waybill->order_type){ $update["order_type"] = $waybill->order_type = Waybill::ORDER_TYPE_DEFAULT; } if (!$waybill->transport_type){ $update["transport_type"] = $waybill->transport_type = "JZKH"; } if (!$waybill->cargo_name){ $update["cargo_name"] = $waybill->cargo_name = "补货"; } if (!$waybill->total_number){ $update["total_number"] = $waybill->total_number = 1; } if (!$waybill->total_weight){ $update["total_weight"] = $waybill->total_weight = 1; } if (!$waybill->package_service){ $update["package_service"] = $waybill->package_service = '托膜'; } if (!$waybill->deliveryType_id){ $update["deliveryType_id"] = $waybill->deliveryType_id = 3; } if (!$waybill->pay_type){ $update["pay_type"] = $waybill->pay_type = Waybill::PAY_TYPE_DEFAULT; } if (!$waybill->back_sign_bill){ $update["back_sign_bill"] = $waybill->back_sign_bill = Waybill::BACK_SIGN_BILL_DEFAULT; } return array($update,$waybill); } }