作者 赵彬吉

update

@@ -177,13 +177,9 @@ class WebTrafficSpecial extends Command @@ -177,13 +177,9 @@ class WebTrafficSpecial extends Command
177 public function handle() 177 public function handle()
178 { 178 {
179 try { 179 try {
180 - $type = $this->argument('type');  
181 -  
182 - $this->sleep(1);  
183 -  
184 $page = 1; 180 $page = 1;
185 while (true){ 181 while (true){
186 - $project_list = $this->getProjectList($type, $page); 182 + $project_list = $this->getProjectList($page);
187 if(!$project_list){ 183 if(!$project_list){
188 break; 184 break;
189 } 185 }
@@ -285,22 +281,9 @@ class WebTrafficSpecial extends Command @@ -285,22 +281,9 @@ class WebTrafficSpecial extends Command
285 } 281 }
286 282
287 /** 283 /**
288 - * 不同项目 休眠  
289 - */  
290 - protected function sleep($type){  
291 - if($type == 1){ //1-3个月的项目  
292 - sleep(rand(5,480));  
293 - }elseif($type == 2){ //4-8个月的项目  
294 - sleep(rand(5,240));  
295 - }elseif($type == 3){ // 大于9个月的项目  
296 - sleep(rand(5,120));  
297 - }  
298 - }  
299 -  
300 - /**  
301 * 非俄语站的引流的项目 284 * 非俄语站的引流的项目
302 */ 285 */
303 - protected function getProjectList($type, $page){ 286 + protected function getProjectList($page){
304 $ru_lang_id = WebLanguage::getIdByLang('ru'); 287 $ru_lang_id = WebLanguage::getIdByLang('ru');
305 288
306 //推广项目 289 //推广项目
@@ -324,7 +307,7 @@ class WebTrafficSpecial extends Command @@ -324,7 +307,7 @@ class WebTrafficSpecial extends Command
324 if(Cache::get('traffic_special_' . $project['project_id'])){ 307 if(Cache::get('traffic_special_' . $project['project_id'])){
325 continue; 308 continue;
326 }else{ 309 }else{
327 - $ttl = 24 * 60 * 60 / $this->projects[$project['project_id']]; 310 + $ttl = 24 * 60 * 60 / $this->projects[$project['project_id']] + sleep(rand(5,480));
328 Cache::put('traffic_special_' . $project['project_id'], 1, $ttl); 311 Cache::put('traffic_special_' . $project['project_id'], 1, $ttl);
329 } 312 }
330 313