前端文件
This commit is contained in:
parent
44ae2a7487
commit
eecc48ad9a
@ -306,12 +306,12 @@ class CeshiController extends BaseApiController
|
|||||||
$all = TaskSchedulingPlan::whereDay('end_time','today')
|
$all = TaskSchedulingPlan::whereDay('end_time','today')
|
||||||
->withJoin(['scheduling'], 'left')
|
->withJoin(['scheduling'], 'left')
|
||||||
->where('scheduling.company_type', 18)
|
->where('scheduling.company_type', 18)
|
||||||
->where('scheduling.company_id', 43)
|
->where('scheduling.company_id', 34)
|
||||||
->where('is_pay',0)
|
// ->where('is_pay',0)
|
||||||
->with(['template_info'])
|
->with(['template_info'])
|
||||||
->select()
|
->select()
|
||||||
->toArray();
|
->toArray();
|
||||||
dd($all);
|
|
||||||
foreach($all as $k=>$data){
|
foreach($all as $k=>$data){
|
||||||
try {
|
try {
|
||||||
TaskSchedulingPlan::where('id', $data['id'])->update(['is_pay' => 1]);
|
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();
|
$task_35 = Task::where('id', $data['task_id'])->field('director_uid,status,money,start_time,end_time')->with('director_info')->find();
|
||||||
if($task_35){
|
if($task_35){
|
||||||
$day= $data['template_info']['stage_day_one'] + $data['template_info']['stage_day_two'];
|
$day= $data['template_info']['stage_day_one'] + $data['template_info']['stage_day_two'];
|
||||||
if($task_35['status']==3 && $data['template_info']['day_count']<=$day){
|
// if($task_35['status']==3 && $data['template_info']['day_count']<=$day){
|
||||||
$name = $task_35['director_info']['nickname'];
|
// $name = $task_35['director_info']['nickname'];
|
||||||
$arr['status'] = 1;
|
// $arr['status'] = 1;
|
||||||
$arr['money'] = $task_35['money'];
|
// $arr['money'] = $task_35['money'];
|
||||||
$arr['company_account_type'] = 2;
|
// $arr['company_account_type'] = 2;
|
||||||
}else{
|
// }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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 判断入股任务 单次类型 是否超时
|
||||||
|
* 未超时时刷新开始结束时间
|
||||||
|
* 超时则关闭
|
||||||
|
*/
|
||||||
|
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{
|
}else{
|
||||||
Log::info('入股任务 ' . $data['template_info']['title'] . '结算失败,任务为空:' . json_encode($data));
|
Log::info('入股任务 ' . $data['template_info']['title'] . '结算失败,任务为空:' . json_encode($data));
|
||||||
return false;
|
return false;
|
||||||
@ -423,7 +426,7 @@ class CeshiController extends BaseApiController
|
|||||||
|
|
||||||
if($data['template_info']['day_count'] >= $day){
|
if($data['template_info']['day_count'] >= $day){
|
||||||
Task::where('id', $data['task_id'])->update(['status' =>5]);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,7 +582,7 @@ class CeshiController extends BaseApiController
|
|||||||
{
|
{
|
||||||
Log::info('村管理公司定时任务结算执行-开始'.date('Y-m-d H:i:s'));
|
Log::info('村管理公司定时任务结算执行-开始'.date('Y-m-d H:i:s'));
|
||||||
//today 今日未结算的任务计划
|
//today 今日未结算的任务计划
|
||||||
$taskSchedulingPlanList = TaskSchedulingPlan::whereDay('end_time','today')
|
$taskSchedulingPlanList = TaskSchedulingPlan::whereDay('end_time','yesterday')
|
||||||
->withJoin(['scheduling'], 'left')
|
->withJoin(['scheduling'], 'left')
|
||||||
->where('scheduling.company_type', 17)
|
->where('scheduling.company_type', 17)
|
||||||
->where('scheduling.company_id', 33)
|
->where('scheduling.company_id', 33)
|
||||||
@ -587,11 +590,11 @@ class CeshiController extends BaseApiController
|
|||||||
->with(['template_info'])
|
->with(['template_info'])
|
||||||
->select()
|
->select()
|
||||||
->toArray();
|
->toArray();
|
||||||
dd($taskSchedulingPlanList);
|
|
||||||
foreach($taskSchedulingPlanList as $taskSchedulingPlan){
|
foreach($taskSchedulingPlanList as $taskSchedulingPlan){
|
||||||
if ($taskSchedulingPlan['template_info']['type'] == 69) {
|
|
||||||
TaskLogic::villageTaskSettlement($taskSchedulingPlan);
|
TaskLogic::villageTaskSettlement($taskSchedulingPlan);
|
||||||
}
|
|
||||||
// queue(VillageTaskSettlementJob::class, $taskSchedulingPlan);
|
// queue(VillageTaskSettlementJob::class, $taskSchedulingPlan);
|
||||||
}
|
}
|
||||||
Log::info('村管理公司定时任务结算执行-结束'.date('Y-m-d H:i:s'));
|
Log::info('村管理公司定时任务结算执行-结束'.date('Y-m-d H:i:s'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user