前端文件

This commit is contained in:
chenbo 2023-12-14 13:34:33 +08:00
parent 44ae2a7487
commit eecc48ad9a

View File

@ -306,12 +306,12 @@ class CeshiController extends BaseApiController
$all = TaskSchedulingPlan::whereDay('end_time','today')
->withJoin(['scheduling'], 'left')
->where('scheduling.company_type', 18)
->where('scheduling.company_id', 43)
->where('is_pay',0)
->where('scheduling.company_id', 34)
// ->where('is_pay',0)
->with(['template_info'])
->select()
->toArray();
dd($all);
foreach($all as $k=>$data){
try {
TaskSchedulingPlan::where('id', $data['id'])->update(['is_pay' => 1]);
@ -377,34 +377,37 @@ class CeshiController extends BaseApiController
$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){
$name = $task_35['director_info']['nickname'];
$arr['status'] = 1;
$arr['money'] = $task_35['money'];
$arr['company_account_type'] = 2;
}else{
/**
* 判断入股任务 单次类型 是否超时
* 未超时时刷新开始结束时间
* 超时则关闭
*/
if($data['template_info']['day_count']<=$day){
TaskSchedulingPlan::where('id', $data['id'])->update(['is_pay' => 0]);
try{
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'=>$task_35['start_time']+86400+86399]);
}catch(\Exception $e){
$start_time = strtotime(date('Y-m-d'));
Task::where('id', $data['task_id'])->update(['create_time' => $start_time+86400,'update_time' =>time(),'start_time'=>$start_time+86400,'end_time'=> $start_time + 86400+86399]);
}
return false;
}
if($data['template_info']['day_count']>$day){
Task::where('id', $data['task_id'])->update(['status' =>5]);
Log::info('入股任务 ' . $data['template_info']['title'] . '结算失败,任务为超时:' . json_encode($data));
return false;
}
// if($task_35['status']==3 && $data['template_info']['day_count']<=$day){
// $name = $task_35['director_info']['nickname'];
// $arr['status'] = 1;
// $arr['money'] = $task_35['money'];
// $arr['company_account_type'] = 2;
// }else{
if ($task_35['status'] == 3) {
return true;
}
/**
* 判断入股任务 单次类型 是否超时
* 未超时时刷新开始结束时间
* 超时则关闭
*/
if($data['template_info']['day_count']<=$day){
TaskSchedulingPlan::where('id', $data['id'])->update(['is_pay' => 0]);
try{
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'=>$task_35['start_time']+86400+86399]);
}catch(\Exception $e){
$start_time = strtotime(date('Y-m-d'));
Task::where('id', $data['task_id'])->update(['create_time' => $start_time+86400,'update_time' =>time(),'start_time'=>$start_time+86400,'end_time'=> $start_time + 86400+86399]);
}
return false;
}
if($data['template_info']['day_count']>$day){
Task::where('id', $data['task_id'])->update(['status' =>5]);
Log::info('入股任务 ' . $data['template_info']['title'] . '结算失败,任务为超时:' . json_encode($data));
return false;
}
// }
}else{
Log::info('入股任务 ' . $data['template_info']['title'] . '结算失败,任务为空:' . json_encode($data));
return false;
@ -423,7 +426,7 @@ class CeshiController extends BaseApiController
if($data['template_info']['day_count'] >= $day){
Task::where('id', $data['task_id'])->update(['status' =>5]);
Log::info('入股任务 ' . $data['template_info']['title'] . '结算失败,任务为超时:' . json_encode($data));
Log::info( $data['template_info']['title'] . '结算失败,任务为超时:' . json_encode($data));
return false;
}
@ -579,7 +582,7 @@ class CeshiController extends BaseApiController
{
Log::info('村管理公司定时任务结算执行-开始'.date('Y-m-d H:i:s'));
//today 今日未结算的任务计划
$taskSchedulingPlanList = TaskSchedulingPlan::whereDay('end_time','today')
$taskSchedulingPlanList = TaskSchedulingPlan::whereDay('end_time','yesterday')
->withJoin(['scheduling'], 'left')
->where('scheduling.company_type', 17)
->where('scheduling.company_id', 33)
@ -587,11 +590,11 @@ class CeshiController extends BaseApiController
->with(['template_info'])
->select()
->toArray();
dd($taskSchedulingPlanList);
foreach($taskSchedulingPlanList as $taskSchedulingPlan){
if ($taskSchedulingPlan['template_info']['type'] == 69) {
TaskLogic::villageTaskSettlement($taskSchedulingPlan);
}
// queue(VillageTaskSettlementJob::class, $taskSchedulingPlan);
}
Log::info('村管理公司定时任务结算执行-结束'.date('Y-m-d H:i:s'));