From 8297752d06d7c130c0c01ab62e5bc45bf5647c91 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 7 Sep 2023 14:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=A1=E6=81=AF=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=94=99=E8=AF=AF=E5=92=8C=E6=97=B6=E9=97=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CeshiController.php | 4 ++-- app/common/logic/task/TaskLogic.php | 2 ++ app/job/TaskInformationJob.php | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/api/controller/CeshiController.php b/app/api/controller/CeshiController.php index 7273d85ca..92c1fe513 100644 --- a/app/api/controller/CeshiController.php +++ b/app/api/controller/CeshiController.php @@ -42,7 +42,7 @@ class CeshiController extends BaseApiController // TaskTemplate::where('id',109)->update(['transaction_pool'=>bcadd($transaction_pool,$day_money,2)]); // } - $all=TaskSchedulingPlan::where('id',928)->with(['template_info','scheduling'])->select()->toArray(); + $all=TaskSchedulingPlan::where('id',943)->with(['template_info','scheduling'])->select()->toArray(); foreach($all as $k=>$v){ queue(TaskInformationJob::class,$v); } @@ -50,7 +50,7 @@ return true; $plan_all = TaskScheduling::where('id',119)->with('company_info')->select()->toArray(); $plan_ids = []; foreach ($plan_all as $k => $v) { - $all = TaskTemplate::where('id', 118)->where('task_scheduling', $v['id'])->limit(30)->select()->toArray(); + $all = TaskTemplate::where('id', 116)->where('task_scheduling', $v['id'])->limit(30)->select()->toArray(); $plan_ids[] = $v['id']; if ($all) { $plan_all[$k]['template'] = $all; diff --git a/app/common/logic/task/TaskLogic.php b/app/common/logic/task/TaskLogic.php index 0f7d93376..eaa9ab81c 100644 --- a/app/common/logic/task/TaskLogic.php +++ b/app/common/logic/task/TaskLogic.php @@ -74,6 +74,8 @@ class TaskLogic extends BaseLogic public static function CronAdd(array $v, $datas): bool { try { + TaskTemplate::where('id', $v['id'])->inc('information_day_count', 5)->update(); + return true; if ($v['types'] == 3) { return true; // $task = Task::where('template_id', $v['id'])->find(); diff --git a/app/job/TaskInformationJob.php b/app/job/TaskInformationJob.php index 6b3d64ee7..ca82d7cb7 100644 --- a/app/job/TaskInformationJob.php +++ b/app/job/TaskInformationJob.php @@ -33,6 +33,7 @@ class TaskInformationJob if ($data['template_info']['information_count'] < $data['template_info']['information_day_count']) { Log::info('信息更新任务,信息更新未达到要求:' . json_encode($data)); Task::where('id', $data['task_id'])->update(['status' => 5]); + TaskTemplate::where('id',$data['template_id'])->update(['information_count'=>$data['template_info']['information_day_count']]); return false; } $name = '小组队长'; @@ -83,7 +84,7 @@ class TaskInformationJob }elseif //入股任务 ($data['template_info']['type'] == 35){ - $task_35 = Task::where('id', $data['task_id'])->field('director_uid,status,money')->with('director_info')->find(); + $task_35 = Task::where('id', $data['task_id'])->field('director_uid,status,money,start_time,end_time')->with('director_info')->find(); if($task_35){ $day= $data['template_info']['stage_day_one'] + $data['template_info']['stage_day_two']; if($task_35['status']==3 && $data['template_info']['day_count']<=$day){ @@ -93,9 +94,8 @@ class TaskInformationJob $arr['company_account_type'] = 2; }else{ if($data['template_info']['day_count']<=$day){ - $time = strtotime(date('Y-m-d')); - Task::where('id', $data['task_id'])->update(['create_time' => $time,'end_time' => $time + 86399,'start_time'=>$time,'end_time'=> $time + 86399]); - return false; + Task::where('id', $data['task_id'])->update(['create_time' => $task_35['start_time']+86400,'update_time' =>time(),'start_time'=>$task_35['start_time']+86400,'end_time'=> strtotime($task_35['end_time']) + 86400]); + return false; } if($data['template_info']['day_count']>$day){ Task::where('id', $data['task_id'])->update(['status' =>5]);