|
@@ -66,12 +66,17 @@ class GeoQuestionRes extends Command |
|
@@ -66,12 +66,17 @@ 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
|
+ try {
|
|
69
|
$result_data = $geoService->setWebSearchChatAction($q_item,$p_item);
|
70
|
$result_data = $geoService->setWebSearchChatAction($q_item,$p_item);
|
|
70
|
echo 'success:'.$result_data['code'].PHP_EOL;
|
71
|
echo 'success:'.$result_data['code'].PHP_EOL;
|
|
71
|
if(isset($result_data) && $result_data['code'] == 200){
|
72
|
if(isset($result_data) && $result_data['code'] == 200){
|
|
72
|
$keywords = $this->getKeywords($keywordArr,$result_data['text'] ?? []);
|
73
|
$keywords = $this->getKeywords($keywordArr,$result_data['text'] ?? []);
|
|
73
|
$urls = $this->getUrl($urlArr,$result_data['annotations'] ?? []);
|
74
|
$urls = $this->getUrl($urlArr,$result_data['annotations'] ?? []);
|
|
74
|
}
|
75
|
}
|
|
|
|
76
|
+ }catch (\Exception $e){
|
|
|
|
77
|
+ echo $e->getMessage().PHP_EOL;
|
|
|
|
78
|
+ continue;
|
|
|
|
79
|
+ }
|
|
75
|
//保存一条结果记录
|
80
|
//保存一条结果记录
|
|
76
|
$data = [
|
81
|
$data = [
|
|
77
|
'project_id'=>$info['project_id'],
|
82
|
'project_id'=>$info['project_id'],
|