diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index bc0eddec3..f7d5bbc63 100755 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -86,11 +86,10 @@ class PayNotifyLogic extends BaseLogic $order->save(); if($order && isset($order['extend']['type']) &&$order['extend']['type']==1){ $find=Task::where('id',$order['extend']['task_id'])->find(); - if($find &&isset($find['extend']['shareholder'])){ + // if($find &&isset($find['extend']['shareholder'])){ Task::where('id',$order['extend']['task_id'])->update(['status'=>3]); - TaskTemplate::where('id',$find['template_id'])->update(['over_decimal'=>$find['extend']['shareholder']['money']]); - - } + TaskTemplate::where('id',$find['template_id'])->update(['over_decimal'=>$order->order_amount]); + // } } } diff --git a/app/common/logic/task/TaskLogic.php b/app/common/logic/task/TaskLogic.php index 80721438c..4bb577daa 100644 --- a/app/common/logic/task/TaskLogic.php +++ b/app/common/logic/task/TaskLogic.php @@ -129,11 +129,12 @@ class TaskLogic extends BaseLogic $v['extend']['shareholder']['user_list'][$kkk]=['name'=>$vvv['nickname'],'money'=>bcdiv($v['recharge'],count($user_ids),2),'time'=>$v['create_time']]; } } + $data['director_uid'] = $datas['company_info']['user_id']; $data['extend']=json_encode($v['extend']); } $task_id = (new Task())->insertGetId($data); TaskSchedulingPlan::where('id', $TaskSchedulingPlan['id'])->update(['task_id' => $task_id, 'is_execute' => 1]); - // TaskTemplate::where('id', $v['id'])->update(['cron_time' => time()]); + TaskTemplate::where('id', $v['id'])->inc('day_count')->update(); return true; } catch (\Exception $e) { Log::error('定时任务添加失败', [$e->getMessage()]); diff --git a/app/job/TaskInformationJob.php b/app/job/TaskInformationJob.php index d5937fbf8..9a88c3334 100644 --- a/app/job/TaskInformationJob.php +++ b/app/job/TaskInformationJob.php @@ -68,6 +68,22 @@ class TaskInformationJob $name=$task['director_info']['nickname']; $arr['status'] = 1; $arr['money'] = $task['money']; + }elseif + //入股任务 + ($data['template_info']['type'] == 35){ + $task_35 = Task::where('id', $data['task_id'])->field('stage_day_one,stage_day_two,status,recharge,day_count,over_decimal')->with('director_info')->find(); + if($task_35){ + $day= $task_35['stage_day_one'] + $task_35['stage_day_two']; + if($task_35['status']==3 && $day<=$task_35['day_count']){ + $name = $task_35['director_info']['nickname']; + $arr['status'] = 1; + $arr['money'] = $task_35['over_decimal']; + }else{ + Log::info('入股任务 ' . $data['template_info']['title'] . '结算失败:' . json_encode($data)); + Task::where('id', $data['task_id'])->update(['status' => 5]); + return false; + } + } } else { //其他类型任务