data["active_test"] = "active"; } public function method(Request $request, $method) { return call_user_func([$this, $method], $request); } public function test1(){ ini_set('max_execution_time',-1); $date = date("Y-m-d H:i:s"); ErrorTemp::query()->truncate(); OwnerFeeStorage::query()->truncate(); OwnerFeeExpress::query()->truncate(); OwnerFeeLogistic::query()->truncate(); OwnerFeeOperation::query()->truncate(); OwnerFeeOperationDetail::query()->truncate(); foreach (Order::query()->where("wms_edittime",">=","2021-08-16 00:00:00") ->where("wms_status","订单完成") ->where("wms_edittime","<",$date)->get() as $order){ $fee = OwnerFeeDetail::query()->where("outer_table_name","orders")->where("outer_id",$order->id)->first(); if ($fee){ OwnerFeeDetailLogistic::query()->where("owner_fee_detail_id",$fee->id)->delete(); $fee->delete(); } $a = new Collection([$order]); $this->dispatch(new OrderCreateInstantBill($a)); } foreach (Store::query()->where("updated_at",">=","2021-08-16 00:00:00") ->where("status","已入库") ->where("updated_at","<",$date)->get() as $store){ OwnerFeeDetail::query()->where("outer_table_name","stores")->where("outer_id",$store->id)->delete(); $a = new Collection([$store]); $this->dispatch(new StoreCreateInstantBill($a)); } } public function test() { ini_set('max_execution_time',-1); $day = (string)\request("day"); $d = (int)$day+1; $d = $d<10 ? '0'.(string)$d : (string)$d; foreach (Order::query()->where("wms_edittime",">=","2021-08-{$day} 00:00:00") ->where("wms_status","订单完成") ->where("wms_edittime","<","2021-08-{$d} 00:00:00")->get() as $order){ $fee = OwnerFeeDetail::query()->where("outer_table_name","orders")->where("outer_id",$order->id)->first(); if ($fee){ OwnerFeeDetailLogistic::query()->where("owner_fee_detail_id",$fee->id)->delete(); $fee->delete(); } $a = new Collection([$order]); $this->dispatch(new OrderCreateInstantBill($a)); } foreach (Store::query()->where("updated_at",">=","2021-08-{$day} 00:00:00") ->where("status","已入库") ->where("updated_at","<","2021-08-{$d} 00:00:00")->get() as $store){ OwnerFeeDetail::query()->where("outer_table_name","stores")->where("outer_id",$store->id)->delete(); $a = new Collection([$store]); $this->dispatch(new StoreCreateInstantBill($a)); } } public function test3() { dispatch(new WeightUpdateInstantBill(OrderPackage::query()->find(17000457))); dispatch(new WeightUpdateInstantBill(OrderPackage::query()->find(17000456))); } public function OwnerStoreFeeReportService_recordReport() { /** @var OwnerStoreFeeReportService $service */ $service = app('OwnerStoreFeeReportService'); $service->recordReport('2021-08-01'); } public function OwnerStoreOutFeeReportService_recordReport() { /** @var OwnerStoreOutFeeReportService $service */ $service = app('OwnerStoreOutFeeReportService'); $service->recordReport('2021-08-01'); } public function OwnerFeeTotalService_record() { /** @var OwnerFeeTotalService $service */ $service = app('OwnerFeeTotalService'); $service->record('2021-08-01'); } //快递 public function OwnerLogisticFeeReportService_record() { ini_set('max_execution_time',-1); /** @var OwnerLogisticFeeReportService $service */ $service = app('OwnerLogisticFeeReportService'); $service->recordReport('2021-08-01'); } public function order_packages_sync_routes_flag_init() { OrderPackage::query()->whereNotNull('transfer_status')->update(['sync_routes_flag'=>true]); } }