|
@@ -66,11 +66,16 @@ class GeoQuestionRes extends Command |
|
@@ -66,11 +66,16 @@ class GeoQuestionRes extends Command |
|
66
|
echo '执行数据详情:'.$q_item.'/'.$p_item.PHP_EOL;
|
66
|
echo '执行数据详情:'.$q_item.'/'.$p_item.PHP_EOL;
|
|
67
|
$keywords = [];//命中的关键词
|
67
|
$keywords = [];//命中的关键词
|
|
68
|
$urls = [];//命中的网址
|
68
|
$urls = [];//命中的网址
|
|
69
|
- $result_data = $geoService->setWebSearchChatAction($q_item,$p_item);
|
|
|
|
70
|
- echo 'success:'.$result_data['code'].PHP_EOL;
|
|
|
|
71
|
- if(isset($result_data) && $result_data['code'] == 200){
|
|
|
|
72
|
- $keywords = $this->getKeywords($keywordArr,$result_data['text'] ?? []);
|
|
|
|
73
|
- $urls = $this->getUrl($urlArr,$result_data['annotations'] ?? []);
|
69
|
+ try {
|
|
|
|
70
|
+ $result_data = $geoService->setWebSearchChatAction($q_item,$p_item);
|
|
|
|
71
|
+ echo 'success:'.$result_data['code'].PHP_EOL;
|
|
|
|
72
|
+ if(isset($result_data) && $result_data['code'] == 200){
|
|
|
|
73
|
+ $keywords = $this->getKeywords($keywordArr,$result_data['text'] ?? []);
|
|
|
|
74
|
+ $urls = $this->getUrl($urlArr,$result_data['annotations'] ?? []);
|
|
|
|
75
|
+ }
|
|
|
|
76
|
+ }catch (\Exception $e){
|
|
|
|
77
|
+ echo $e->getMessage().PHP_EOL;
|
|
|
|
78
|
+ continue;
|
|
74
|
}
|
79
|
}
|
|
75
|
//保存一条结果记录
|
80
|
//保存一条结果记录
|
|
76
|
$data = [
|
81
|
$data = [
|