作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !2353
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 namespace App\Console\Commands\Geo; 10 namespace App\Console\Commands\Geo;
11 11
  12 +use App\Helper\Translate;
12 use App\Models\Geo\GeoPlatform; 13 use App\Models\Geo\GeoPlatform;
13 use App\Models\Geo\GeoQuestion; 14 use App\Models\Geo\GeoQuestion;
14 use App\Models\Geo\GeoQuestionLog; 15 use App\Models\Geo\GeoQuestionLog;
@@ -75,6 +76,7 @@ class GeoQuestionRes extends Command @@ -75,6 +76,7 @@ class GeoQuestionRes extends Command
75 $geoResultModel = new GeoQuestionResult(); 76 $geoResultModel = new GeoQuestionResult();
76 $geoLogModel = new GeoQuestionLog(); 77 $geoLogModel = new GeoQuestionLog();
77 foreach ($taskInfo['question'] as $question) { 78 foreach ($taskInfo['question'] as $question) {
  79 + $en_question = Translate::tran($question, 'zh') ?? '';
78 foreach ($platformsArr as $platform) { 80 foreach ($platformsArr as $platform) {
79 $data = $hit_data = []; 81 $data = $hit_data = [];
80 $error_num = 0; 82 $error_num = 0;
@@ -83,7 +85,7 @@ class GeoQuestionRes extends Command @@ -83,7 +85,7 @@ class GeoQuestionRes extends Command
83 $error_num++; 85 $error_num++;
84 try { 86 try {
85 echo '执行次数:'.$error_num.PHP_EOL; 87 echo '执行次数:'.$error_num.PHP_EOL;
86 - if ($error_num >= 5) { 88 + if ($error_num >= 3) {
87 continue; 89 continue;
88 } 90 }
89 echo '执行平台:'.$platform.PHP_EOL; 91 echo '执行平台:'.$platform.PHP_EOL;
@@ -132,6 +134,7 @@ class GeoQuestionRes extends Command @@ -132,6 +134,7 @@ class GeoQuestionRes extends Command
132 'type' => $taskInfo['type'] ?? $geoQuestionModel::TYPE_BRAND, 134 'type' => $taskInfo['type'] ?? $geoQuestionModel::TYPE_BRAND,
133 'platform' => $platform, 135 'platform' => $platform,
134 'question' => $question, 136 'question' => $question,
  137 + 'en_question'=> $en_question,
135 'keywords' => json_encode($hit_keyword,true),//命中的关键词 138 'keywords' => json_encode($hit_keyword,true),//命中的关键词
136 'url' => json_encode($hit_url,true),//命中的网址 139 'url' => json_encode($hit_url,true),//命中的网址
137 'text' => json_encode($result,true), 140 'text' => json_encode($result,true),