作者 赵彬吉

update

... ... @@ -177,13 +177,9 @@ class WebTrafficSpecial extends Command
public function handle()
{
try {
$type = $this->argument('type');
$this->sleep(1);
$page = 1;
while (true){
$project_list = $this->getProjectList($type, $page);
$project_list = $this->getProjectList($page);
if(!$project_list){
break;
}
... ... @@ -285,22 +281,9 @@ class WebTrafficSpecial extends Command
}
/**
* 不同项目 休眠
*/
protected function sleep($type){
if($type == 1){ //1-3个月的项目
sleep(rand(5,480));
}elseif($type == 2){ //4-8个月的项目
sleep(rand(5,240));
}elseif($type == 3){ // 大于9个月的项目
sleep(rand(5,120));
}
}
/**
* 非俄语站的引流的项目
*/
protected function getProjectList($type, $page){
protected function getProjectList($page){
$ru_lang_id = WebLanguage::getIdByLang('ru');
//推广项目
... ... @@ -324,7 +307,7 @@ class WebTrafficSpecial extends Command
if(Cache::get('traffic_special_' . $project['project_id'])){
continue;
}else{
$ttl = 24 * 60 * 60 / $this->projects[$project['project_id']];
$ttl = 24 * 60 * 60 / $this->projects[$project['project_id']] + sleep(rand(5,480));
Cache::put('traffic_special_' . $project['project_id'], 1, $ttl);
}
... ...