合并分支 'lyh-server' 到 'master'
变更数据 查看合并请求 !3052
正在显示
1 个修改的文件
包含
3 行增加
和
11 行删除
| @@ -29,6 +29,9 @@ class GeoQuestionRes extends Command | @@ -29,6 +29,9 @@ class GeoQuestionRes extends Command | ||
| 29 | * @var string | 29 | * @var string |
| 30 | */ | 30 | */ |
| 31 | protected $signature = 'geo_question_result'; | 31 | protected $signature = 'geo_question_result'; |
| 32 | + | ||
| 33 | + public $porject_id;//记录当时执行的project_id | ||
| 34 | + | ||
| 32 | /** | 35 | /** |
| 33 | * The console command description. | 36 | * The console command description. |
| 34 | * | 37 | * |
| @@ -37,14 +40,6 @@ class GeoQuestionRes extends Command | @@ -37,14 +40,6 @@ class GeoQuestionRes extends Command | ||
| 37 | protected $description = 'geo设置请求获取结果'; | 40 | protected $description = 'geo设置请求获取结果'; |
| 38 | 41 | ||
| 39 | 42 | ||
| 40 | - public function demo() | ||
| 41 | - { | ||
| 42 | - // 1 2 | ||
| 43 | - // getTaskId -> redis -> [] 1、unlock -> select ; 2:lock sleep | ||
| 44 | - // 1:select, 2:redis -> pop task | ||
| 45 | - // last:mysql status:0, 1:running 2:1->running | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | /** | 43 | /** |
| 49 | * @return bool | 44 | * @return bool |
| 50 | */ | 45 | */ |
| @@ -56,8 +51,6 @@ class GeoQuestionRes extends Command | @@ -56,8 +51,6 @@ class GeoQuestionRes extends Command | ||
| 56 | sleep(300); | 51 | sleep(300); |
| 57 | continue; | 52 | continue; |
| 58 | } | 53 | } |
| 59 | - $key = 'geo_question_result_' . date('Y-m-d') . '_' . $task_id; | ||
| 60 | - $ttl = 600; | ||
| 61 | $this->output('执行的任务ID:' . $task_id); | 54 | $this->output('执行的任务ID:' . $task_id); |
| 62 | $geoQuestionModel = new GeoQuestion(); | 55 | $geoQuestionModel = new GeoQuestion(); |
| 63 | $taskInfo = $geoQuestionModel->read(['id'=>$task_id]); | 56 | $taskInfo = $geoQuestionModel->read(['id'=>$task_id]); |
| @@ -87,7 +80,6 @@ class GeoQuestionRes extends Command | @@ -87,7 +80,6 @@ class GeoQuestionRes extends Command | ||
| 87 | $geoResultModel = new GeoQuestionResult(); | 80 | $geoResultModel = new GeoQuestionResult(); |
| 88 | $geoLogModel = new GeoQuestionLog(); | 81 | $geoLogModel = new GeoQuestionLog(); |
| 89 | foreach ($taskInfo['question'] as $question) { | 82 | foreach ($taskInfo['question'] as $question) { |
| 90 | - | ||
| 91 | $en_question = Translate::tran($question, 'zh') ?? ''; | 83 | $en_question = Translate::tran($question, 'zh') ?? ''; |
| 92 | $this->output('项目ID:' . $taskInfo['project_id'] . ', 问题 开始:' . $question); | 84 | $this->output('项目ID:' . $taskInfo['project_id'] . ', 问题 开始:' . $question); |
| 93 | foreach ($platformsArr as $platform) { | 85 | foreach ($platformsArr as $platform) { |
-
请 注册 或 登录 后发表评论