data["active_test"]="active"; } public function method(Request $request,$method) { return call_user_func([$this, $method],$request); } function t1(Request $request){ //x dd(date('Y-m-d h:i:s',1586481486)); } 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::where('delivery_number','<>',null)->where('logistic_id',null)->get(); dd($packages); $packages=Package::whereRaw('delivery_number IS NOT NULL AND logistic_id IS NULL')->get(); $logistics=Logistic::get(); $packages->each(function ($package)use($logistics){ $logistics->each(function ($logistic)use($package){ if ($package->WMSReflectPackage->CarrierID==$logistic->code){ $package->logistic_id=$logistic->id; return; } }); }); return "OK"; } public function tNull(){ } public function deletePackageAuthority() { $authorities=Authority::where('name','like','%包裹信息%')->get(); $authorities->each(function ($authority){ $authority->delete(); }); } public function test1(){ $processDailiesStatistic=ProcessDaily::where('process_id',6)->get(); $a=$processDailiesStatistic->max('output'); $b=$processDailiesStatistic->min('output'); $c=$processDailiesStatistic->avg('output'); dd($a,$b,$c); } }