From c26ba285fb7dd146bb0bddde3c68fcb65aa1feab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Fri, 12 Dec 2025 12:31:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4-=E6=AF=8F=E6=97=A5=E7=AD=BE=E5=88=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91-=E7=AD=BE=E5=88=B0=E7=A4=BC?= =?UTF-8?q?=E7=89=A9=E5=8F=91=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cron/controller/Test.php | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/application/cron/controller/Test.php b/application/cron/controller/Test.php index 661772b6..52a567ff 100644 --- a/application/cron/controller/Test.php +++ b/application/cron/controller/Test.php @@ -187,5 +187,36 @@ class Test } } } + /* + * 任务历史数据补发 + */ + public function task_history_send(){ + echo "开始补发任务历史数据 \n"; + $user_list = db::name('user')->where(['status'=>1,'delete_time'=>0])->select(); + //任务 + $task_list = db::name('vs_tasks')->where(['task_type'=>1,'delete_time'=>0])->select(); + foreach ($user_list as $key=>$value){ + foreach ($task_list as $k=>$v){ + if($v['id']==3){//实名认证任务 + //判断用户是否实名认证 + $is_real = model('api/UserData')->real_name_info($value['id']); + if($is_real['code']==1&&$is_real['data']['is_real'] ==1){ + model('Tasks')->tasks_complete($value['id'],3); + } + } + //任务历史 + $task_history = db::name('vs_task_history')->where(['task_id'=>$v['id'],'user_id'=>$value['id']])->find(); + if(empty($task_history)){ + //添加任务历史 + $task_history_data = [ + 'task_id' => $v['id'], + 'user_id' => $value['id'], + 'status' => 1, + ] + } + } + // + } + } } \ No newline at end of file