更新信息更新错误和时间问题

This commit is contained in:
mkm 2023-09-07 14:50:16 +08:00
parent 4bd5427158
commit 8297752d06
3 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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]);