| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace App\Http\Controllers;
- use App\Components\AsyncResponse;
- use App\Components\Database;
- use App\Components\ErrorPush;
- use App\MaterialBox;
- use App\MaterialBoxModel;
- use App\Services\AuthorityService;
- use App\Services\RejectedService;
- use App\User;
- use App\Waybill;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Log;
- class TestController extends Controller
- {
- use AsyncResponse, ErrorPush, Database;
- const ASNREFERENCE_2 = 'ASNREFERENCE2';
- public function __construct()
- {
- $this->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);
- }
- }
|