table($table) ->where([ 'ip' => $ip, 'connection_id' => $ranseId, 'link_source' => 'tiktok', ])->where('created_at', '>=', $now - 180) ->orderBy('id', 'desc') ->first(); if($record) { break; } } return $record ? [ 'callback' => $record->callback, 'advertiser_id' => $record->advertiser_id, 'adv_promotion_id' => $record->promotion_id ] : null; break; } return null; } public static function getTrackTable($endTimstamp, $duration) { $currentYm = date('Ym', $endTimstamp); $startCurrentYm = date('Ym', $endTimstamp - $duration); $tables = ['douyin_tracks'.$currentYm]; if($currentYm != $startCurrentYm) { $tables[] = 'douyin_tracks'.$startCurrentYm; } return $tables; } }