作者 lyh

gx

... ... @@ -84,11 +84,10 @@ class GeoQuestionRes extends Command
GET_RESULT:
$error_num++;
try {
echo '执行次数:'.$error_num.PHP_EOL;
echo '执行时间:'.date('Y-m-d H:i:s').'->执行次数:'.$error_num.',执行平台:'.$platform.PHP_EOL;
if ($error_num >= 3) {
continue;
}
echo '执行平台:'.$platform.PHP_EOL;
if ($platform == 'Google AI Overview') {
// overview 数据结构不确定, 需要单独处理数据
$data = $geo_service->getGooglePlatformResult($question);
... ... @@ -125,7 +124,7 @@ class GeoQuestionRes extends Command
$hit++;
}
}
echo 'MZ-url'.json_encode($hit_url).PHP_EOL;
echo 'MZ-url->'.json_encode($hit_url).PHP_EOL;
// 保存数据结果
$geo_result = $geoResultModel->read(['project_id' => $taskInfo['project_id'],'type' => $taskInfo['type'], 'question_id' => $task_id, 'platform' => $platform, 'question' => $question],['id']);
$save_data = [
... ... @@ -145,7 +144,6 @@ class GeoQuestionRes extends Command
// echo '当前数据INFO:'.json_encode($save_data,true).PHP_EOL;
if($geo_result === false){
$id= $geoResultModel->insertGetId($save_data);
echo '当前数据id:'.$id.PHP_EOL;
}else{
$geoResultModel->edit($save_data, ['id' => $geo_result['id']]);
}
... ...