data["active_test"]="active"; } public function method(Request $request,$method) { return call_user_func([$this, $method],$request); } function t1(Request $request){ //x ; dd( 1579040093,Carbon::createFromTimestamp(1579040093)->toDateTimeString()); } function tj(Request $request){ $bills=RejectedBill::where('is_loaded',2)->where('created_at','<',Carbon::now()->subHours(10)->toDateTimeString()); $bills->each(function ($bill){ $receives=WMSReflectReceive::where('ASNREFERENCE3',$bill['logistic_number_return'])->where('is_uploaded',0)->get(); if($receives->isNotEmpty()){ event(new WmsReceiveNewEvent($bill['logistic_number_return'],$receives->first())); (new Controller())->log(__METHOD__,'replenished_'.__FUNCTION__,$bill['logistic_number_return']); } }); } function injectJS(Request $request){ $items=RejectedBillItem::whereHas('rejectedBill',function($query){ return $query->where('id_owner',2); })->where('created_at','>','2019-12-23 18:11:00')->where('created_at','<','2019-12-24 11:25:00')->get(); (new RejectedBillItemController())->collectionsToPackConfirm($items); } public function tj2(Request $request) { $rejected = Rejected::find(10); $rejectedJianshang=new \App\Http\Controllers\api\jianshang\RejectedController(); dd( $rejectedJianshang->sendRejected($rejected)); } public function excelIt() { $excel=new ExcelController(); return $excel->makeExcel(); } public function featureIt() { LogisticNumberFeatureController::loadRecentRejectedsToFeatures(5,2500); } public function newSku() { $url='http://bswcs/api/sorting/flux/newSku'; $response = Zttp::post($url, [ 'request'=>[ [ "SKU"=> "1234567890", "NAME"=> "瑞士莲**巧克力", "Alternate_SKU1"=> "1122334455", "GrossWeight"=> "1.2", "Cube"=> "0.75", "SKULength"=> "0.25", "SKUWidth"=> "0.15", "SKUHigh"=> "0.05" ], [ "SKU"=> "1234567892", "NAME"=> "跳跳饼", "Alternate_SKU1"=> "", "GrossWeight"=> "1.3", "Cube"=> "0.75", "SKULength"=> "0.25", "SKUWidth"=> "0.15", "SKUHigh"=> "0.25" ], ] ]); return $response->json(); } public function changePackage(){ $packages=Package::whereRaw('delivery_number IS NOT NULL AND logistic_id IS NULL')->get(); $logistics=Logistic::get(); foreach ($packages as $package){ foreach ($logistics as $logistic){ if ($package->WMSReflectPackage->CarrierID==$logistic->code){ $package->logistic_id=$logistic->id; break; } } } return "OK"; } }