make(UserHistoryRepository::class)->createOrUpdate($data); if ($spu) { $make = app()->make(UserVisitRepository::class); $count = $make->search(['uid' => $data['uid'], 'type' => 'product'])->where('type_id', $spu['product_id'])->whereTime('create_time', '>', date('Y-m-d H:i:s', strtotime('- 300 seconds')))->count(); if (!$count) { SwooleTaskService::visit(intval($data['uid']), $spu['product_id'], 'product'); } } }catch (\Exception $e){ } $job->delete(); } public function failed($data) { // TODO: Implement failed() method. } }