|
...
|
...
|
@@ -81,6 +81,9 @@ class GeoQuestionRes extends Command |
|
|
|
GET_RESULT:
|
|
|
|
$error_num++;
|
|
|
|
try {
|
|
|
|
if ($error_num >= 5) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if ($platform == 'Google AI Overview') {
|
|
|
|
continue;
|
|
|
|
// overview 数据结构不确定, 需要单独处理数据
|
|
...
|
...
|
@@ -94,10 +97,7 @@ class GeoQuestionRes extends Command |
|
|
|
}
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
$this->output('task id:' . $task_id . ', question: ' . $question . ', platform: ' . $question . ', error: ' . $e->getMessage());
|
|
|
|
if ($error_num < 2) {
|
|
|
|
goto GET_RESULT;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
goto GET_RESULT;
|
|
|
|
}
|
|
|
|
// 命中文案
|
|
|
|
$hit_data[] = $result['text'];
|
|
...
|
...
|
@@ -140,7 +140,7 @@ class GeoQuestionRes extends Command |
|
|
|
if($geo_result === false){
|
|
|
|
$geoResultModel->addReturnId($save_data);
|
|
|
|
}else{
|
|
|
|
$geoResultModel->edit($save_data, ['id' => $geo_result->id]);
|
|
|
|
$geoResultModel->edit($save_data, ['id' => $geo_result['id']]);
|
|
|
|
}
|
|
|
|
$save_data['text'] = json_encode(FALSE == empty($data) ? $data : $result,true);
|
|
|
|
$geoLogModel->addReturnId($data);
|
...
|
...
|
|