diff --git a/app/api/controller/VehicleController.php b/app/api/controller/VehicleController.php index 2c6bdc2e9..3e39d5a31 100644 --- a/app/api/controller/VehicleController.php +++ b/app/api/controller/VehicleController.php @@ -576,7 +576,7 @@ class VehicleController extends BaseApiController if($company['company_type'] != 16){ return $this->fail('非镇街公司不能访问'); } - $data = VehicleContract::field('id,contract_no,contract_url,status,create_time,update_time')->where('contract_logistic_id','<>',0)->where('company_b_id',$company['id'])->select(); + $data = VehicleContract::field('id,contract_no,contract_url,status,create_time,update_time')->where('contract_logistic_id',0)->where('company_b_id',$company['id'])->select(); return $this->success('请求成功',$data->toArray()); } diff --git a/app/common/logic/CompanyLogic.php b/app/common/logic/CompanyLogic.php index ead329db4..c38ca32e7 100644 --- a/app/common/logic/CompanyLogic.php +++ b/app/common/logic/CompanyLogic.php @@ -115,6 +115,10 @@ class CompanyLogic extends BaseLogic //小组服务公司 AdminLogic::insertRole($admin_id, [6]); $admin['group_id']=5; + } elseif ($params['company_type']==41) { + //镇管理公司 总负责人 + AdminLogic::insertRole($admin_id, [7]); //后台角色 + $admin['group_id']=15; // 前台角色 } $userSn = User::createUserSn(); $admin['admin_id']=$admin_id; diff --git a/app/task/TaskCron.php b/app/task/TaskCron.php index 0e09578cd..a7e5485c2 100644 --- a/app/task/TaskCron.php +++ b/app/task/TaskCron.php @@ -20,7 +20,7 @@ class TaskCron extends Task // $this->everyMinute();//每分钟 } /** - * 执行任务 + * 小组服务公司执行任务下发 * @return mixed */ protected function execute() @@ -29,7 +29,8 @@ class TaskCron extends Task // $time=strtotime(date('Y-m-d',strtotime('-1 day'))); $time = strtotime(date('Y-m-d')); // $tiem_end=$time+86399; - $plan_all = TaskScheduling::where('cron_time', '<', $time)->where('status', 1)->with('company_info')->select()->toArray(); + // 查询系统目前小组公司的任务安排 + $plan_all = TaskScheduling::where('cron_time', '<', $time)->where('status', 1)->where('company_type', 18)->with('company_info')->select()->toArray(); $plan_ids = []; foreach ($plan_all as $k => $v) { $all = TaskTemplate::where('status', 1)->where('task_scheduling', $v['id'])->limit(30)->select()->toArray(); diff --git a/app/task/TaskSettlementCron.php b/app/task/TaskSettlementCron.php index c28a2a343..efff52cb8 100644 --- a/app/task/TaskSettlementCron.php +++ b/app/task/TaskSettlementCron.php @@ -21,9 +21,20 @@ class TaskSettlementCron extends Task{ protected function execute() { //yesterday - $all=TaskSchedulingPlan::whereDay('end_time','yesterday')->where('is_pay',0)->with(['template_info','scheduling'=>function($query){ - $query->where('company_type', 18); - }])->select()->toArray(); +// $all=TaskSchedulingPlan::whereDay('end_time','yesterday') +// ->where('is_pay',0) +// ->with(['template_info','scheduling'=>function($query){ +// $query->where('company_type', 18); +// }]) +// ->select() +// ->toArray(); + $all = TaskSchedulingPlan::whereDay('end_time','yesterday') + ->withJoin(['scheduling'], 'left') + ->where('scheduling.company_type', 18) + ->where('is_pay',0) + ->with(['template_info']) + ->select() + ->toArray(); foreach($all as $k=>$v){ queue(TaskInformationJob::class,$v); }