作者 lyh
@@ -370,11 +370,7 @@ class RelayInquiry extends Command @@ -370,11 +370,7 @@ class RelayInquiry extends Command
370 370
371 $this->output('获取转发ip'); 371 $this->output('获取转发ip');
372 // TODO 获取IP:如果是简码,查询数据库获取对应的国家, 如果是国家使用翻译, 再转化成IP 372 // TODO 获取IP:如果是简码,查询数据库获取对应的国家, 如果是国家使用翻译, 再转化成IP
373 - if (strlen($form->country) == 2) {  
374 - $country = $this->getCountry($form->country);  
375 - } else {  
376 - $country = Translate::tran($form->country, 'zh');  
377 - } 373 + $country = $form->country_name;
378 // 有国家 通过国家查询, 如果没有获取到就随机获取 374 // 有国家 通过国家查询, 如果没有获取到就随机获取
379 $where = []; 375 $where = [];
380 $country && $where['ip_area'] = $country; 376 $country && $where['ip_area'] = $country;
@@ -499,22 +495,6 @@ class RelayInquiry extends Command @@ -499,22 +495,6 @@ class RelayInquiry extends Command
499 } 495 }
500 496
501 /** 497 /**
502 - * 通过国家简码获取国家名称  
503 - * @param $code  
504 - * @return string  
505 - */  
506 - public function getCountry($code)  
507 - {  
508 - $cache_key = 'inquiry_world_country';  
509 - $country_code = Cache::get($cache_key, function () use ($cache_key) {  
510 - $country_code = DB::table('gl_world_country_city')->where(['pid' => 0])->pluck('chinese_name', 'iso2')->toArray();  
511 - Cache::put($cache_key, $country_code, 86400);  
512 - return $country_code;  
513 - });  
514 - return empty($country_code[$code]) ? '' : $country_code[$code];  
515 - }  
516 -  
517 - /**  
518 * 获取头信息 498 * 获取头信息
519 * @param $ip_area 499 * @param $ip_area
520 * @param $lang 500 * @param $lang
@@ -56,10 +56,12 @@ class MessagePush extends Base @@ -56,10 +56,12 @@ class MessagePush extends Base
56 return false; 56 return false;
57 } 57 }
58 58
  59 + //特殊处理, 要求任何时候收到询盘都要及时推送到群里面
  60 + $special_project_ids = [650];
59 //9-21 点,每条消息及时通知 61 //9-21 点,每条消息及时通知
60 //21-第二天 9 点,整合一起通知 62 //21-第二天 9 点,整合一起通知
61 $hour = date('H', strtotime($submit_at)); 63 $hour = date('H', strtotime($submit_at));
62 - if($hour >= 9 && $hour < 21) { 64 + if(($hour >= 9 && $hour < 21) || in_array($project_id, $special_project_ids)) {
63 $model = new self(); 65 $model = new self();
64 $model->project_id = $project_id; 66 $model->project_id = $project_id;
65 $model->friend_id = $friend_id; 67 $model->friend_id = $friend_id;