|
...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
namespace App\Console\Commands\Geo;
|
|
|
|
|
|
|
|
use App\Helper\Translate;
|
|
|
|
use App\Models\Geo\GeoPlatform;
|
|
|
|
use App\Models\Geo\GeoQuestion;
|
|
|
|
use App\Models\Geo\GeoQuestionLog;
|
|
...
|
...
|
@@ -75,6 +76,7 @@ class GeoQuestionRes extends Command |
|
|
|
$geoResultModel = new GeoQuestionResult();
|
|
|
|
$geoLogModel = new GeoQuestionLog();
|
|
|
|
foreach ($taskInfo['question'] as $question) {
|
|
|
|
$en_question = Translate::tran($question, 'zh') ?? '';
|
|
|
|
foreach ($platformsArr as $platform) {
|
|
|
|
$data = $hit_data = [];
|
|
|
|
$error_num = 0;
|
|
...
|
...
|
@@ -83,7 +85,7 @@ class GeoQuestionRes extends Command |
|
|
|
$error_num++;
|
|
|
|
try {
|
|
|
|
echo '执行次数:'.$error_num.PHP_EOL;
|
|
|
|
if ($error_num >= 5) {
|
|
|
|
if ($error_num >= 3) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
echo '执行平台:'.$platform.PHP_EOL;
|
|
...
|
...
|
@@ -132,6 +134,7 @@ class GeoQuestionRes extends Command |
|
|
|
'type' => $taskInfo['type'] ?? $geoQuestionModel::TYPE_BRAND,
|
|
|
|
'platform' => $platform,
|
|
|
|
'question' => $question,
|
|
|
|
'en_question'=> $en_question,
|
|
|
|
'keywords' => json_encode($hit_keyword,true),//命中的关键词
|
|
|
|
'url' => json_encode($hit_url,true),//命中的网址
|
|
|
|
'text' => json_encode($result,true),
|
...
|
...
|
|