jobsRepository = $jobsRepository; $this->jobsContactRepository = $jobsContactRepository; $this->companyRepository = $companyRepository; $this->membersSetmealRepository = $memberSetmealRepository; $this->personalJobsApplyRepository = $personalJobsApplyRepository; $this->auditReasonsRepository = $auditReasonsRepository; $this->refreshLogRepository = $refreshLogRepository; $this->memberPointRepository = $memberPointRepository; $this->setmealRepository = $setmealRepository; $this->memberHandselRepository = $memberHandselRepository; $this->membersSetmealLogRepository = $membersSetmealLogRepository; $this->categoryRepository = $categoryRepository; $this->categoryJobsRepository = $categoryJobsRepository; $this->categoryDistrictRepository = $categoryDistrictRepository; $this->resumeRepository = $resumeRepository; $this->viewJobRepository = $viewJobRepository; $this->personFavoriteRepository = $personFavoriteRepository; $this->queueAutoRefreshRepository = $queueAutoRefreshRepository; $this->orderRepository = $orderRepository; $this->companyStatisticsRepository = $companyStatisticsRepository; $this->jobfairJobRepository = $jobfairJobRepository; $this->jobfairJobsContactRepository = $jobfairJobsContactRepository; $this->subsiteJobRepository = $subsiteJobRepository; $this->paymentService = $paymentService; $this->orderService = $orderService; $this->payService = $payService; $this->serviceService = $serviceService; $this->ResumePrivacyRepository = $ResumePrivacyRepository; $this->memberLogRepository=$memberLogRepository; $this->smsService = $smsService; $this->pmsService = $pmsService; } public function getJobs($where, $where_in, $order_by = '', $fileds = '', $offset = '', $limit = '') { $rst = $this->jobsRepository->getCrmJobs($where, $where_in, $order_by, $fileds, $offset, $limit); return $rst; } public function getJobNums($where, $where_in) { $rst = $this->jobsRepository->getCrmJobCount($where, $where_in); return $rst; } public function dealjobFilelds($list, $map_data = array(), $limit = '') { $return_list = array(); foreach ($list as $key => $val) { if ($limit && ($key >= $limit)) { break; } $arr = $val->toArray(); $arr['jobs_name']=cut_str($val->jobs_name, 12, 0, "..."); $arr['companyname']=cut_str($val->company_name, 18, 0, "..."); $arr['company_url'] = route(url_rewrite('AIX_companyshow'), ['id'=> $val->company_id]); $arr['jobs_url'] = route(url_rewrite('AIX_jobslist'), ['id'=> $val->id]); $arr['minwage'] = $val->wage_min; $return_list[$key] = $arr; } return $return_list; } public function getAutoRefreshJobs($where, $group_by) { $rst = $this->queueAutoRefreshRepository->getCrmRefreshs($where, $group_by); return $rst; } public function auditJobs($data){ $ids = ''; if (array_has($data, 'id')) { $ids = $data['id']; } if (!$ids) { return ['status'=>0,'msg'=>'请选择要审核的职位']; } $id = explode(',', $ids); $job_com_ids =$this->jobsRepository->findWhereIn('id', $id, ['company_id','id','jobs_name'])->toArray(); $reason = ''; if (array_has($data, 'reason')) { $reason = $data['reason']; } $audit = 0; if (array_has($data, 'audit')) { $audit = $data['audit']; } $data = ['audit'=>$audit]; $auditusername = 'CRM业务员'; if (array_has($data, 'auditusername')) { $auditusername = $data['auditusername']; } if (Jobs::jobsUpdate($id, $data)) { event_search_update(Jobs::class, implode(',', $id), 'update'); if ($job_com_ids) { $company_ids = []; foreach ($company_ids as $k => $c) { $company_ids[] = $c['company_id']; } $company_condition = [['whereIn','id', $company_ids]]; event_search_update(Company::class, $company_condition, 'update'); } switch ($audit) { case 1: $html = "通过审核"; $alias=Smser::TEMPLATE_SMS_JOBSALLOW; break; case 3: $html = "未通过审核"; $alias=Smser::TEMPLATE_SMS_JOBSNOTALLOW; break; } $mobile = []; foreach ($id as $key => $val) { $jobsInfo = Jobs::with('jobsContact')->find($val); if ($jobsInfo->jobsContact && $jobsInfo->jobsContact->telephone) { if(!in_array($jobsInfo->jobsContact->telephone, $mobile)){ $mobile[] = $jobsInfo->jobsContact->telephone; $this->smsService->sendSms($jobsInfo->jobsContact->telephone, $alias, ['sitename'=>config('aix.system.site.site.site_name'),'jobsname'=>$jobsInfo->jobs_name,'sitedomain'=>config('aix.system.site.site.site_domain')]); } } } //审核日志 $auditData= []; $auditData['ids'] = $id; $auditData['status'] = $audit; $auditData['type'] = 3; $auditData['reason'] = $reason; if ($auditusername) { $auditData['audit_man'] = $auditusername; } AuditReason::addData($auditData); // 站内信 $insertData = []; foreach ($job_com_ids as $key => $val) { $insertData[$key] = array( 'utype' => 1, 'msgtype' => 1, 'msgfromuid' => 0, 'msgfrom' => $auditusername, 'msgtoname' =>getComUserName($val['company_id']), 'msgtouid' => $val['company_id'], 'message' => '职位ID:'.$val['id'].',职位名称:'.$val['jobs_name'].','.$html.',【备注】'.$reason, 'new' => 1, 'created_at' =>date('Y-m-d H:i:s', time()), 'updated_at' =>date('Y-m-d H:i:s', time()), ); } $this->pmsService->addBatchPms($insertData); return ['status'=>1,'msg'=>'职位审核成功']; } else { return ['status'=>0,'msg'=>'职位审核失']; } } public function getJobInfo($id) { $info = $this->jobsRepository->getCrmInfo(['id'=>$id]); if (!$info) { return ['status'=>0, 'msg'=>'没有找到对应的职位!']; } $info->companyname = $info->company_name; $info->user = $info->company; $info->contact = $info->jobsContact; $info->contents = $info->jobs_content; $info->addtime = strtotime($info->created_at); $info->refreshtime = $info->refresh_time; if ($info->wage == -1) { $info->negotiable = 1; } $info->minwage = $info->wage_min; $info->maxwage = $info->wage_max; //职位亮点 $tag_cn = []; if ($info->tag) { foreach ($info->tag as $k => $v) { if ($tag = get_category($v)) { $tag_cn[] = $tag; } } } $info->tag_cn = implode(',', $tag_cn); //职位性质 $info->nature_cn = get_category($info->nature); //工作地区 $district_cn = []; $district = string_to_array('.', $info->district); foreach ($district as $key => $val) { $district_cn[] = get_district_cn($val); } $info->district_cn = implode(',', $district_cn); //职位类别 $category_cn = ''; if ($info->subclass) { $category_cn = get_job_category($info->subclass); } elseif ($info->category) { $category_cn = get_job_category($info->category); } $info->category_cn = $category_cn; $info->education_cn = $info->education?get_category($info->education):'不限'; //学历要求 $info->experience_cn = $info->experience?get_category($info->experience):'不限'; //工作经验 //性别 $sex_cn = '不限'; if ($info->sex == 1) { $sex_cn = '男'; } elseif ($info->sex == 2) { $sex_cn = '女'; } else { $sex_cn = '不限'; } $info->sex_cn = $sex_cn; //年龄要求 $info->minage = 0; $info->maxage = 0; $age = $info->age; if ($info->age[0]) { $info->minage = $info->age[0]; } if ($info->age[1]) { $info->maxage = $info->age[1]; } //处理固定电话 $tels =[]; if ($info->jobsContact) { $tel_arr = $info->jobsContact->landline_tel; if ($tel_arr) { if (implode('', $tel_arr)) { foreach ($tel_arr as $k => $v) { if ($v == '') { unset($tel_arr[$k]); } } } $tels = $tel_arr; } } $info->telarray = $tels; return ['status'=>1, 'msg'=>$info]; } //获取智能刷新职位 public function getAutoRefresh($where) { return $this->queueAutoRefreshRepository->findData($where); } }