|
@@ -51,18 +51,18 @@ class JobsController extends Controller
|
|
|
|
|
|
/**
|
|
|
* JobsController constructor.
|
|
|
- * @param JobsRepository $jobsRepository.
|
|
|
- * @param SubsiteService $subsiteService.
|
|
|
- * @param PmsService $pmsService.
|
|
|
+ * @param JobsRepository $jobsRepository .
|
|
|
+ * @param SubsiteService $subsiteService .
|
|
|
+ * @param PmsService $pmsService .
|
|
|
*/
|
|
|
- public function __construct(JobsRepository $jobsRepository, PmsService $pmsService, SubsiteService $subsiteService, SmsService $smsService, WechatService $wechatService,EmailService $emailService)
|
|
|
+ public function __construct(JobsRepository $jobsRepository, PmsService $pmsService, SubsiteService $subsiteService, SmsService $smsService, WechatService $wechatService, EmailService $emailService)
|
|
|
{
|
|
|
$this->jobsRepository = $jobsRepository;
|
|
|
- $this->pmsService = $pmsService;
|
|
|
+ $this->pmsService = $pmsService;
|
|
|
$this->subsiteService = $subsiteService;
|
|
|
- $this->smsService = $smsService;
|
|
|
- $this->wechatService = $wechatService;
|
|
|
- $this->emailService = $emailService;
|
|
|
+ $this->smsService = $smsService;
|
|
|
+ $this->wechatService = $wechatService;
|
|
|
+ $this->emailService = $emailService;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -71,9 +71,9 @@ class JobsController extends Controller
|
|
|
* @param Content $content
|
|
|
* @return Content
|
|
|
*/
|
|
|
- public function index(Content $content)
|
|
|
+ public function index(Content $content)
|
|
|
{
|
|
|
- $grid=$this->grid()->render();
|
|
|
+ $grid = $this->grid()->render();
|
|
|
return $content
|
|
|
->header('职位管理')
|
|
|
->description('列表')
|
|
@@ -154,19 +154,19 @@ ETO;
|
|
|
{
|
|
|
Permission::check('jobs_manager');
|
|
|
$grid = new Grid(new Jobs);
|
|
|
- $grid->model()->with(['jobsContact','company'])->when(get_subsite_id()>0, function ($query) {
|
|
|
- $query->where('subsite_id', get_subsite_id());
|
|
|
+ $grid->model()->with(['jobsContact', 'company'])->when(get_subsite_id() > 0, function ($query) {
|
|
|
+ $query->where('subsite_id', get_subsite_id());
|
|
|
})->when(Admin::user()->isRole(AdminRole::$consultantSlug), function ($query) {
|
|
|
- $query->whereHas('companyConsultant',function ($query){
|
|
|
+ $query->whereHas('companyConsultant', function ($query) {
|
|
|
$query->where('consultant_id', isset(Admin::user()->consultant->id) ? Admin::user()->consultant->id : -1);
|
|
|
});
|
|
|
})->orderByRaw('field(audit,0,2,1,3)')->orderBy('created_at', 'desc');
|
|
|
$grid->id('id');
|
|
|
$grid->jobs_name('职位名称')->display(function ($jobs_name) {
|
|
|
- return "<a href=".route(url_rewrite('AIX_jobsshow'), ['id'=>$this->id])." target='_blank' title='".$jobs_name."' style='display:inline-block;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;max-width:180px'>".$jobs_name."</a>";
|
|
|
+ return "<a href=" . route(url_rewrite('AIX_jobsshow'), ['id' => $this->id]) . " target='_blank' title='" . $jobs_name . "' style='display:inline-block;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;max-width:180px'>" . $jobs_name . "</a>";
|
|
|
})->width(200);
|
|
|
$grid->column('promition', '推广类型')->display(function ($promition) {
|
|
|
- $stick = '';
|
|
|
+ $stick = '';
|
|
|
$emergency = '';
|
|
|
if ($this->stick == 0 && $this->emergency == 0) {
|
|
|
return "<span>无推广</span>";
|
|
@@ -175,13 +175,13 @@ ETO;
|
|
|
$stick = "<span>已置顶</span>";
|
|
|
}
|
|
|
if ($this->emergency == 1) {
|
|
|
- $emergency ='<span>已紧急</span>';
|
|
|
+ $emergency = '<span>已紧急</span>';
|
|
|
}
|
|
|
- return $stick.$emergency;
|
|
|
+ return $stick . $emergency;
|
|
|
}
|
|
|
});
|
|
|
$grid->company_name('公司名称')->display(function ($company_name) {
|
|
|
- return "<a href=". route(url_rewrite('AIX_companyshow'), ['id'=>$this->company_id])." title='".$company_name."' target='_blank' style='display:inline-block;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;max-width:200px'>".$company_name."</a>";
|
|
|
+ return "<a href=" . route(url_rewrite('AIX_companyshow'), ['id' => $this->company_id]) . " title='" . $company_name . "' target='_blank' style='display:inline-block;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;max-width:200px'>" . $company_name . "</a>";
|
|
|
})->width(200);
|
|
|
$grid->audit('审核状态')->display(function ($audit) {
|
|
|
switch ($audit) {
|
|
@@ -189,25 +189,25 @@ ETO;
|
|
|
// return '未审核<a class="logview" data-id='.$this->id.'><i class="fa fa-eye"></i></a>';
|
|
|
break;
|
|
|
case 1:
|
|
|
- return '<span style="color: green">审核通过</span><a class="logview" data-id='.$this->id.'><i class="fa fa-eye"></i></a>';
|
|
|
+ return '<span style="color: green">审核通过</span><a class="logview" data-id=' . $this->id . '><i class="fa fa-eye"></i></a>';
|
|
|
break;
|
|
|
case 2:
|
|
|
- return '<span style="color: red">审核中<a class="logview" data-id='.$this->id.'><i class="fa fa-eye"></i></a></span>';
|
|
|
+ return '<span style="color: red">审核中<a class="logview" data-id=' . $this->id . '><i class="fa fa-eye"></i></a></span>';
|
|
|
break;
|
|
|
case 3:
|
|
|
- return '<span style="color: black">审核未通过</span><a class="logview" data-id='.$this->id.'><i class="fa fa-eye"></i></a>';
|
|
|
+ return '<span style="color: black">审核未通过</span><a class="logview" data-id=' . $this->id . '><i class="fa fa-eye"></i></a>';
|
|
|
break;
|
|
|
}
|
|
|
});
|
|
|
- if(get_subsite_open()) {
|
|
|
+ if (get_subsite_open()) {
|
|
|
$grid->subsite_id('所属分站')->display(function ($subsite_id) {
|
|
|
if ($subsite_id == 0) {
|
|
|
return "总站";
|
|
|
} else {
|
|
|
- try{
|
|
|
+ try {
|
|
|
$subsite = Subsite::findOrFail($subsite_id);
|
|
|
return $subsite->sitename;
|
|
|
- }catch (\Exception $exception){
|
|
|
+ } catch (\Exception $exception) {
|
|
|
return "--";
|
|
|
}
|
|
|
|
|
@@ -231,13 +231,13 @@ ETO;
|
|
|
$actions->disableEdit(false);
|
|
|
}
|
|
|
if (Admin::user()->can('company_manager_bussiness')) {
|
|
|
- $actions->append("<button class='btn btn-primary btn-xs business' id=".$actions->row['company_id'].">业务</button>");
|
|
|
+ $actions->append("<button class='btn btn-primary btn-xs business' id=" . $actions->row['company_id'] . ">业务</button>");
|
|
|
}
|
|
|
if (Admin::user()->can('jobs_manager_delete')) {
|
|
|
$actions->disableDelete(false);
|
|
|
}
|
|
|
if (Admin::user()->can('jobs_manager_audit')) {
|
|
|
- $actions->append("<button class='btn btn-primary btn-xs jobaudit' data-code=".$actions->row['id'].">审核</button>");
|
|
|
+ $actions->append("<button class='btn btn-primary btn-xs jobaudit' data-code=" . $actions->row['id'] . ">审核</button>");
|
|
|
}
|
|
|
});
|
|
|
if (Admin::user()->can('jobs_export')) {
|
|
@@ -247,39 +247,40 @@ ETO;
|
|
|
|
|
|
$grid->filter(function ($filter) {
|
|
|
// 在这里添加字段过滤器
|
|
|
- $filter->column(1/2, function ($filter) {
|
|
|
+ $filter->column(1 / 2, function ($filter) {
|
|
|
$filter->like('jobs_name', '职位名称');
|
|
|
$filter->equal('company_id', '企业id');
|
|
|
$filter->equal('audit', '职位审核')->select(['1' => '审核通过', '2' => '审核中', '3' => '审核未通过']);
|
|
|
$filter->where(function ($query) {
|
|
|
if ($this->input == '1') {
|
|
|
- $query->where(['stick'=>0,'emergency'=>0]);
|
|
|
- } elseif ($this->input==2) {
|
|
|
- $query->where(['stick'=>1]);
|
|
|
- } elseif ($this->input==3) {
|
|
|
- $query->where(['emergency'=>1]);
|
|
|
+ $query->where(['stick' => 0, 'emergency' => 0]);
|
|
|
+ } elseif ($this->input == 2) {
|
|
|
+ $query->where(['stick' => 1]);
|
|
|
+ } elseif ($this->input == 3) {
|
|
|
+ $query->where(['emergency' => 1]);
|
|
|
}
|
|
|
}, '推广类型', 'promotion')->select([0 => '不限', 1 => '未推广', 2 => '置顶', 3 => '紧急'])->default('0');
|
|
|
- $filter->equal('valid', '有效状态')->select(['0'=>'无效职位', '1'=>'有效职位']);
|
|
|
- $filter->equal('is_health', '卫健系统')->select(['1'=>'是', '2'=>'否']);
|
|
|
- $filter->equal('is_ic', '集成电路')->select(['1'=>'是', '2'=>'否']);
|
|
|
+ $filter->equal('valid', '有效状态')->select(['0' => '无效职位', '1' => '有效职位']);
|
|
|
+ $filter->equal('is_health', '卫健系统')->select([1 => '是', 2 => '否']);
|
|
|
+ $filter->equal('health_type', '卫健招聘分类')->select([1 => '高层次人才', 2 => '紧缺急需', 3 => '统招', 4 => '编外'])->default(1);
|
|
|
+ $filter->equal('is_ic', '集成电路')->select([1 => '是', 2 => '否']);
|
|
|
});
|
|
|
- $filter->column(1/2, function ($filter) {
|
|
|
+ $filter->column(1 / 2, function ($filter) {
|
|
|
$filter->equal('id', '职位ID');
|
|
|
$filter->like('company_name', '企业名称');
|
|
|
- if(get_subsite_open()) {
|
|
|
- $subsite = Subsite::where('effective', 1)->select('id', 'sitename')->get();
|
|
|
- $subsiteArr = [];
|
|
|
- if ($subsite) {
|
|
|
- $subsiteArr = $subsite->toArray();
|
|
|
- $subsiteArr = array_column($subsiteArr, 'sitename', 'id');
|
|
|
- }
|
|
|
- $subsiteArr[0] = "总站";
|
|
|
- ksort($subsiteArr);
|
|
|
- if (get_subsite_id() == 0) {
|
|
|
- $filter->equal('subsite_id', '所属分站')->select($subsiteArr);
|
|
|
- }
|
|
|
- }
|
|
|
+ if (get_subsite_open()) {
|
|
|
+ $subsite = Subsite::where('effective', 1)->select('id', 'sitename')->get();
|
|
|
+ $subsiteArr = [];
|
|
|
+ if ($subsite) {
|
|
|
+ $subsiteArr = $subsite->toArray();
|
|
|
+ $subsiteArr = array_column($subsiteArr, 'sitename', 'id');
|
|
|
+ }
|
|
|
+ $subsiteArr[0] = "总站";
|
|
|
+ ksort($subsiteArr);
|
|
|
+ if (get_subsite_id() == 0) {
|
|
|
+ $filter->equal('subsite_id', '所属分站')->select($subsiteArr);
|
|
|
+ }
|
|
|
+ }
|
|
|
$filter->between('created_at', '发布时间')->datetime();
|
|
|
$filter->use(new TimestampBetween('refresh_time', '刷新时间'))->datetime();
|
|
|
});
|
|
@@ -294,20 +295,20 @@ ETO;
|
|
|
if (Admin::user()->can('jobs_manager_audit')) {
|
|
|
$form = new \Encore\Admin\Widgets\Form();
|
|
|
$form->action(route('jobs.audit'));
|
|
|
- $form->radio('audit1', '审核状态')->options([1=>'审核通过', 3=>'审核未通过'])->default(1);
|
|
|
+ $form->radio('audit1', '审核状态')->options([1 => '审核通过', 3 => '审核未通过'])->default(1);
|
|
|
$states = [
|
|
|
'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],
|
|
|
'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],
|
|
|
];
|
|
|
$form->textarea('reason', '备注');
|
|
|
$form->html("<input type='checkbox' name='is_send' checked value='1'/>站内信通知");
|
|
|
- $config = array(
|
|
|
- 'button' => "审核",//添加的按钮文字
|
|
|
- 'title' => "将所选职位",//弹窗标题
|
|
|
+ $config = [
|
|
|
+ 'button' => "审核",//添加的按钮文字
|
|
|
+ 'title' => "将所选职位",//弹窗标题
|
|
|
'dialog_cancel' => "取消",//取消文字
|
|
|
- 'dialog_ok' => "确认",//确认文字
|
|
|
- 'is_batch' => true//是否批量操作,如果是批量操作则提交表单时会带上ids参数
|
|
|
- );
|
|
|
+ 'dialog_ok' => "确认",//确认文字
|
|
|
+ 'is_batch' => true,//是否批量操作,如果是批量操作则提交表单时会带上ids参数
|
|
|
+ ];
|
|
|
$tools->append(new DialogTool($form, $config));
|
|
|
}
|
|
|
});
|
|
@@ -359,39 +360,39 @@ ETO;
|
|
|
return get_category($nature);
|
|
|
}
|
|
|
});
|
|
|
- $show->ygxs('用工形式')->as(function ($ygxs){
|
|
|
- if (isset(Category::categoryType('AIX_ygxs')[$ygxs])){
|
|
|
+ $show->ygxs('用工形式')->as(function ($ygxs) {
|
|
|
+ if (isset(Category::categoryType('AIX_ygxs')[$ygxs])) {
|
|
|
return Category::categoryType('AIX_ygxs')[$ygxs];
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
});
|
|
|
- $show->techlevel('技能等级')->as(function ($techlevel){
|
|
|
- if (isset(Category::categoryType('AIX_techlevel')[$techlevel])){
|
|
|
+ $show->techlevel('技能等级')->as(function ($techlevel) {
|
|
|
+ if (isset(Category::categoryType('AIX_techlevel')[$techlevel])) {
|
|
|
return Category::categoryType('AIX_techlevel')[$techlevel];
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return "";
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- if ($jobs->ygxs!=363){ //不等于小时工显示
|
|
|
- $show->syq('试用期时间')->as(function ($syq){
|
|
|
- if (isset(Category::categoryType('zs_syq')[$syq])){
|
|
|
+ if ($jobs->ygxs != 363) { //不等于小时工显示
|
|
|
+ $show->syq('试用期时间')->as(function ($syq) {
|
|
|
+ if (isset(Category::categoryType('zs_syq')[$syq])) {
|
|
|
return Category::categoryType('zs_syq')[$syq];
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
});
|
|
|
- if ($jobs->syq!=367){ //试用期无不显示
|
|
|
+ if ($jobs->syq != 367) { //试用期无不显示
|
|
|
$show->syqxz_min('试用期薪资');
|
|
|
}
|
|
|
|
|
|
- }else{
|
|
|
- $show->wage_min('小时工薪资')->as(function ($wage_min){
|
|
|
+ } else {
|
|
|
+ $show->wage_min('小时工薪资')->as(function ($wage_min) {
|
|
|
|
|
|
- return $wage_min."元/小时";
|
|
|
+ return $wage_min . "元/小时";
|
|
|
|
|
|
});
|
|
|
}
|
|
@@ -421,7 +422,7 @@ ETO;
|
|
|
|
|
|
|
|
|
$show->category('职位分类')->as(function ($category) {
|
|
|
- return get_job_category_cn($this->topclass.'.'.$category.'.'.$this->subclass);
|
|
|
+ return get_job_category_cn($this->topclass . '.' . $category . '.' . $this->subclass);
|
|
|
});
|
|
|
$show->subsite_id('所属分站')->as(function ($subsite_id) {
|
|
|
if ($subsite_id == 0) {
|
|
@@ -443,7 +444,7 @@ ETO;
|
|
|
});
|
|
|
if ($jobs->wage == -1) {
|
|
|
$show->wage_cn('薪资待遇')->as(function () {
|
|
|
- return $this->wage_min.'~'.$this->wage_max.'/月';
|
|
|
+ return $this->wage_min . '~' . $this->wage_max . '/月';
|
|
|
});
|
|
|
} elseif ($jobs->wage == 0) {
|
|
|
$show->wage_cn('薪资待遇')->as(function () {
|
|
@@ -464,7 +465,7 @@ ETO;
|
|
|
});
|
|
|
$show->experience('工作经验')->as(function ($experience) {
|
|
|
if ($experience) {
|
|
|
- return get_category($experience);
|
|
|
+ return get_category($experience);
|
|
|
} else {
|
|
|
return '不限';
|
|
|
}
|
|
@@ -474,7 +475,7 @@ ETO;
|
|
|
if (!$sex) {
|
|
|
return '不限';
|
|
|
} else {
|
|
|
- return $sex==1?"男":"女";
|
|
|
+ return $sex == 1 ? "男" : "女";
|
|
|
}
|
|
|
});
|
|
|
$show->amount('招聘人数');
|
|
@@ -502,21 +503,21 @@ ETO;
|
|
|
{
|
|
|
Permission::check('jobs_manager_edit');
|
|
|
$form = new Form(new Jobs);
|
|
|
- $form->tab('职位信息', function (Form $form) use ($id) {
|
|
|
- $jobsData = Jobs::where('id', $id)->select('audit','negotiable', 'age', 'topclass', 'category', 'subclass', 'district', 'wage', 'wage_min', 'wage_max')->first()->toArray();
|
|
|
- session(["jobsData"=>$jobsData]);
|
|
|
-
|
|
|
- if ($jobsData['district']) {
|
|
|
- $district = string_to_array('.', $jobsData['district']);
|
|
|
- }
|
|
|
- $form->display('id');
|
|
|
- $form->text('jobs_name', '职位名称')->rules(['required'], ['required'=>'请填写职位名称'])->setMustMark();
|
|
|
- $form->display('company_name', '公司名称');
|
|
|
- $form->radio('display', '在招状态')->options([1=>'在招',2=>'关闭']);
|
|
|
- $form->radio('audit', '审核状态')->options([1=>'审核通过',2=>'审核中',3=>'审核未通过']);
|
|
|
- $jobsNature = Category::categoryType('AIX_jobs_nature');
|
|
|
- $jobsNature[0] ='不限';
|
|
|
- $form->radio('nature', '职位性质')->options($jobsNature);
|
|
|
+ $form->tab('职位信息', function (Form $form) use ($id) {
|
|
|
+ $jobsData = Jobs::where('id', $id)->select('audit', 'negotiable', 'age', 'topclass', 'category', 'subclass', 'district', 'wage', 'wage_min', 'wage_max')->first()->toArray();
|
|
|
+ session(["jobsData" => $jobsData]);
|
|
|
+
|
|
|
+ if ($jobsData['district']) {
|
|
|
+ $district = string_to_array('.', $jobsData['district']);
|
|
|
+ }
|
|
|
+ $form->display('id');
|
|
|
+ $form->text('jobs_name', '职位名称')->rules(['required'], ['required' => '请填写职位名称'])->setMustMark();
|
|
|
+ $form->display('company_name', '公司名称');
|
|
|
+ $form->radio('display', '在招状态')->options([1 => '在招', 2 => '关闭']);
|
|
|
+ $form->radio('audit', '审核状态')->options([1 => '审核通过', 2 => '审核中', 3 => '审核未通过']);
|
|
|
+ $jobsNature = Category::categoryType('AIX_jobs_nature');
|
|
|
+ $jobsNature[0] = '不限';
|
|
|
+ $form->radio('nature', '职位性质')->options($jobsNature);
|
|
|
// if (get_subsite_id()==0 && get_subsite_open()) {
|
|
|
// $subsites = Subsite::where(array('effective'=>1))->orderBy('order', 'asc')->get()->pluck('sitename', 'id');
|
|
|
// if ($subsites) {
|
|
@@ -533,233 +534,237 @@ ETO;
|
|
|
// $form->select('techlevel', '技能等级')->options(Category::categoryType('AIX_techlevel'))->setMustMark();
|
|
|
|
|
|
|
|
|
- $form->select('topclass', '职位大类')->options(CategoryJobs::List()->pluck('name', 'id'))->load('category',admin_base_path('/sys/categoryJobs/category'))->rules('required', array('required'=>'请选择职位大类'))->setMustMark();
|
|
|
- $form->select('category', '职位中类')->options(CategoryJobs::category($jobsData['topclass']))->load('subclass',admin_base_path('/sys/categoryJobs/category'))->rules('required', array('required'=>'请选择职位中类'))->setMustMark();
|
|
|
- $form->select('subclass', '职位小类')->options(CategoryJobs::category($jobsData['category']))->rules('required', array('required'=>'请选择职位小类'))->setMustMark();
|
|
|
- if (!empty($district)) {
|
|
|
- if (!isset($district[1])){$district[1]=""; $district[2]="";}//没有的话给默认值
|
|
|
- $form->select('province', '所属省份')->options(CategoryDistrict::List()->pluck('name', 'id'))->setWidth(3)->load('city', admin_base_path('sys/category/categoryDis'))->rules('required', ['required'=>'请选择相应的企业所属省份'])->default($district[0])->setMustMark();
|
|
|
- $form->select('city', '所属城市')->options(CategoryDistrict::categoryDis($district[0]))->setWidth(3)->load('area', admin_base_path('sys/category/categoryDis'))->rules('required', ['required'=>'请选择相应的企业所属城市'])->default($district[1])->setMustMark();
|
|
|
- //$form->select('area', '所属县区')->default(0)->setWidth(3)->setMustMark();
|
|
|
+ $form->select('topclass', '职位大类')->options(CategoryJobs::List()->pluck('name', 'id'))->load('category', admin_base_path('/sys/categoryJobs/category'))->rules('required', ['required' => '请选择职位大类'])->setMustMark();
|
|
|
+ $form->select('category', '职位中类')->options(CategoryJobs::category($jobsData['topclass']))->load('subclass', admin_base_path('/sys/categoryJobs/category'))->rules('required', ['required' => '请选择职位中类'])->setMustMark();
|
|
|
+ $form->select('subclass', '职位小类')->options(CategoryJobs::category($jobsData['category']))->rules('required', ['required' => '请选择职位小类'])->setMustMark();
|
|
|
+ if (!empty($district)) {
|
|
|
+ if (!isset($district[1])) {
|
|
|
+ $district[1] = "";
|
|
|
+ $district[2] = "";
|
|
|
+ }//没有的话给默认值
|
|
|
+ $form->select('province', '所属省份')->options(CategoryDistrict::List()->pluck('name', 'id'))->setWidth(3)->load('city', admin_base_path('sys/category/categoryDis'))->rules('required', ['required' => '请选择相应的企业所属省份'])->default($district[0])->setMustMark();
|
|
|
+ $form->select('city', '所属城市')->options(CategoryDistrict::categoryDis($district[0]))->setWidth(3)->load('area', admin_base_path('sys/category/categoryDis'))->rules('required', ['required' => '请选择相应的企业所属城市'])->default($district[1])->setMustMark();
|
|
|
+ //$form->select('area', '所属县区')->default(0)->setWidth(3)->setMustMark();
|
|
|
|
|
|
- } else {
|
|
|
- $form->select('province', '所属省份')->options(CategoryDistrict::List()->pluck('name', 'id'))->setWidth(3)->load('city', admin_base_path('sys/category/categoryDis'))->rules('required', ['required'=>'请选择相应的企业所属省份'])->default(0)->setMustMark();
|
|
|
- $form->select('city', '所属城市')->setWidth(3)->load('area', admin_base_path('sys/category/categoryDis'))->rules('required', ['required'=>'请选择相应的企业所属城市'])->default(0)->setMustMark();
|
|
|
- //$form->select('area', '所属县区')->setWidth(3)->default(0)->setMustMark();
|
|
|
+ } else {
|
|
|
+ $form->select('province', '所属省份')->options(CategoryDistrict::List()->pluck('name', 'id'))->setWidth(3)->load('city', admin_base_path('sys/category/categoryDis'))->rules('required', ['required' => '请选择相应的企业所属省份'])->default(0)->setMustMark();
|
|
|
+ $form->select('city', '所属城市')->setWidth(3)->load('area', admin_base_path('sys/category/categoryDis'))->rules('required', ['required' => '请选择相应的企业所属城市'])->default(0)->setMustMark();
|
|
|
+ //$form->select('area', '所属县区')->setWidth(3)->default(0)->setMustMark();
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
// $form->select('syq', '试用期时间')->options(Category::categoryType('zs_syq'))->rules('required', array('required'=>'请选择试用期时间'))->setMustMark();
|
|
|
// $form->number('syqxz_min', '试用期薪资')->min(config('aix.companyset.comset.com_set.wage_min'));
|
|
|
|
|
|
- if ($jobsData['wage'] == 0) {
|
|
|
- $form->hidden('wage');
|
|
|
- $form->number('wage_min', '最低薪资')->min(config('aix.companyset.comset.com_set.wage_min'))->help("请填写大于".config('aix.companyset.comset.com_set.wage_min')."的10的倍数");
|
|
|
- $form->number('wage_max', '最高薪资')->help("请填写大于最低薪资的10的倍数");
|
|
|
- } else {
|
|
|
- $option = Category::categoryType('AIX_wage');
|
|
|
- $option[-1] ='面议';
|
|
|
- $form->select('wage', '薪资待遇')->options($option)->default($jobsData['wage']);
|
|
|
- $form->hidden('wage_min');
|
|
|
- $form->hidden('wage_max');
|
|
|
- }
|
|
|
-
|
|
|
- $education = Category::categoryType('AIX_education');
|
|
|
- $education['0']='不限';
|
|
|
- $form->radio('education', '学历要求')->options($education);
|
|
|
- $experience = Category::categoryType('AIX_experience');
|
|
|
- $experience['0']="不限";
|
|
|
- $form->radio('experience', '工作经验')->options($experience);
|
|
|
- $form->radio('sex', '性别要求')->options([0=>'不限',1=>'男',2=>'女']);
|
|
|
- $form->radio('is_health', '卫健系统')->options([1=>'是',2=>'否'])->default(2);
|
|
|
- $form->radio('is_ic', '集成电路')->options([1=>'是',2=>'否'])->default(2);
|
|
|
- $form->radio('is_deformity', '是否接受残疾人')->options([1=>'是',2=>'否'])->default(2);
|
|
|
- $form->radio('is_soldier', '是否接受退役军人')->options([1=>'是',2=>'否'])->default(2);
|
|
|
-
|
|
|
- $form->number('min_age', '最低年龄')->default(isset($jobsData['age'][0])?$jobsData['age'][0]:'')->min(16)->max(65)->help('最低年龄不能低于国家规定用工年龄');
|
|
|
- $form->number('max_age', '最高年龄')->default(isset($jobsData['age'][1])?$jobsData['age'][1]:'')->min(16)->max(65)->help('最高年龄不能高于65周岁');
|
|
|
-
|
|
|
- $form->number('amount', '招聘人数')->min(1)->max(99)->rules(['required'], ['required'=>'请输入招聘人数'])->help('请填写招聘人数1~99')->setMustMark();
|
|
|
- $form->multipleSelect('tag', '职位亮点')->options(Category::categoryType('AIX_jobtag'));
|
|
|
- $form->textarea('jobs_content', '职位描述')->attribute(['maxlength'=>2000])->rules(['required'], ['required'=>"请填写职位描述"])->setMustMark();
|
|
|
- })->tab('联系人', function (Form $form) {
|
|
|
- $form->text("contact.contact", '联系人')->setWidth(3);
|
|
|
- $form->radio('contact.contact_show', '联系人是否公开')->options([0=>'不公开',1=>'公开']);
|
|
|
-
|
|
|
- $form->text('contact.telephone', '联系电话')->setWidth(3);
|
|
|
- $form->radio('contact.telephone_show', '联系电话是否公开')->options([0=>'不公开',1=>'公开']);
|
|
|
+ if ($jobsData['wage'] == 0) {
|
|
|
+ $form->hidden('wage');
|
|
|
+ $form->number('wage_min', '最低薪资')->min(config('aix.companyset.comset.com_set.wage_min'))->help("请填写大于" . config('aix.companyset.comset.com_set.wage_min') . "的10的倍数");
|
|
|
+ $form->number('wage_max', '最高薪资')->help("请填写大于最低薪资的10的倍数");
|
|
|
+ } else {
|
|
|
+ $option = Category::categoryType('AIX_wage');
|
|
|
+ $option[-1] = '面议';
|
|
|
+ $form->select('wage', '薪资待遇')->options($option)->default($jobsData['wage']);
|
|
|
+ $form->hidden('wage_min');
|
|
|
+ $form->hidden('wage_max');
|
|
|
+ }
|
|
|
+
|
|
|
+ $education = Category::categoryType('AIX_education');
|
|
|
+ $education['0'] = '不限';
|
|
|
+ $form->radio('education', '学历要求')->options($education);
|
|
|
+ $experience = Category::categoryType('AIX_experience');
|
|
|
+ $experience['0'] = "不限";
|
|
|
+ $form->radio('experience', '工作经验')->options($experience);
|
|
|
+ $form->radio('sex', '性别要求')->options([0 => '不限', 1 => '男', 2 => '女']);
|
|
|
+ $form->radio('is_health', '卫健系统')->options([1 => '是', 2 => '否'])->default(2);
|
|
|
+ $form->radio('health_type', '卫健招聘分类')->options([1 => '高层次人才', 2 => '紧缺急需', 3 => '统招', 4 => '编外'])->default(1);
|
|
|
+ $form->radio('is_ic', '集成电路')->options([1 => '是', 2 => '否'])->default(2);
|
|
|
+ $form->radio('is_deformity', '是否接受残疾人')->options([1 => '是', 2 => '否'])->default(2);
|
|
|
+ $form->radio('is_soldier', '是否接受退役军人')->options([1 => '是', 2 => '否'])->default(2);
|
|
|
+
|
|
|
+ $form->number('min_age', '最低年龄')->default(isset($jobsData['age'][0]) ? $jobsData['age'][0] : '')->min(16)->max(65)->help('最低年龄不能低于国家规定用工年龄');
|
|
|
+ $form->number('max_age', '最高年龄')->default(isset($jobsData['age'][1]) ? $jobsData['age'][1] : '')->min(16)->max(65)->help('最高年龄不能高于65周岁');
|
|
|
+
|
|
|
+ $form->number('amount', '招聘人数')->min(1)->max(99)->rules(['required'], ['required' => '请输入招聘人数'])->help('请填写招聘人数1~99')->setMustMark();
|
|
|
+ $form->multipleSelect('tag', '职位亮点')->options(Category::categoryType('AIX_jobtag'));
|
|
|
+ $form->textarea('jobs_content', '职位描述')->attribute(['maxlength' => 2000])->rules(['required'], ['required' => "请填写职位描述"])->setMustMark();
|
|
|
+ })->tab('联系人', function (Form $form) {
|
|
|
+ $form->text("contact.contact", '联系人')->setWidth(3);
|
|
|
+ $form->radio('contact.contact_show', '联系人是否公开')->options([0 => '不公开', 1 => '公开']);
|
|
|
+
|
|
|
+ $form->text('contact.telephone', '联系电话')->setWidth(3);
|
|
|
+ $form->radio('contact.telephone_show', '联系电话是否公开')->options([0 => '不公开', 1 => '公开']);
|
|
|
|
|
|
// $form->text('contact.landline_tel', '固定电话')->setWidth(3)->help('区号-号码-分机号(以“-”分隔)'); //这个字段引起问题
|
|
|
// $form->radio('contact.landline_tel_show', '固定电话是否公开')->options([0=>'不公开',1=>'公开']);
|
|
|
|
|
|
- $form->text('contact.email', 'Email')->setWidth(3);
|
|
|
- $form->radio('contact.email_show', 'Email是否公开')->options([0=>'不公开',1=>'公开']);
|
|
|
-
|
|
|
- $form->text('contact.address', '联系地址')->setWidth(3);
|
|
|
- });
|
|
|
+ $form->text('contact.email', 'Email')->setWidth(3);
|
|
|
+ $form->radio('contact.email_show', 'Email是否公开')->options([0 => '不公开', 1 => '公开']);
|
|
|
|
|
|
+ $form->text('contact.address', '联系地址')->setWidth(3);
|
|
|
+ });
|
|
|
|
|
|
|
|
|
- $form->disableEditingCheck();
|
|
|
- $form->disableCreatingCheck();
|
|
|
- $form->disableViewCheck();
|
|
|
- $form->disableReset();
|
|
|
- $form->tools(function ($tools) {
|
|
|
- $tools->disableView();
|
|
|
- $tools->disableDelete();
|
|
|
- });
|
|
|
+ $form->disableEditingCheck();
|
|
|
+ $form->disableCreatingCheck();
|
|
|
+ $form->disableViewCheck();
|
|
|
+ $form->disableReset();
|
|
|
+ $form->tools(function ($tools) {
|
|
|
+ $tools->disableView();
|
|
|
+ $tools->disableDelete();
|
|
|
+ });
|
|
|
|
|
|
- $form->ignore('province');
|
|
|
- $form->ignore('city');
|
|
|
- $form->ignore('area');
|
|
|
- $form->ignore('min_age');
|
|
|
- $form->ignore('max_age');
|
|
|
- $form->ignore(['relate_subsites']);
|
|
|
- $form->saving(function (Form $form) {
|
|
|
- $minage = Input::get('min_age');
|
|
|
- $maxage = Input::get('max_age');
|
|
|
- if ($maxage && $minage) {
|
|
|
- if ($maxage <=$minage) {
|
|
|
- $error = new MessageBag([
|
|
|
- 'title' => '提示',
|
|
|
- 'message' => '最高年龄不能小最低年龄',
|
|
|
- ]);
|
|
|
- return back()->with(compact('error'));
|
|
|
- }
|
|
|
+ $form->ignore('province');
|
|
|
+ $form->ignore('city');
|
|
|
+ $form->ignore('area');
|
|
|
+ $form->ignore('min_age');
|
|
|
+ $form->ignore('max_age');
|
|
|
+ $form->ignore(['relate_subsites']);
|
|
|
+ $form->saving(function (Form $form) {
|
|
|
+ $minage = Input::get('min_age');
|
|
|
+ $maxage = Input::get('max_age');
|
|
|
+ if ($maxage && $minage) {
|
|
|
+ if ($maxage <= $minage) {
|
|
|
+ $error = new MessageBag([
|
|
|
+ 'title' => '提示',
|
|
|
+ 'message' => '最高年龄不能小最低年龄',
|
|
|
+ ]);
|
|
|
+ return back()->with(compact('error'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($form->wage == -1) {
|
|
|
+ $form->wage_min = 0;
|
|
|
+ $form->wage_max = 0;
|
|
|
+ } else {
|
|
|
+ if ($form->wage != 0) {
|
|
|
+ $wage = explode('~', format_wage(get_category($form->wage)));
|
|
|
+ if (isset($wage[1])) {
|
|
|
+ $form->wage_max = $wage[1];
|
|
|
}
|
|
|
- if ($form->wage == -1) {
|
|
|
- $form->wage_min = 0;
|
|
|
- $form->wage_max = 0;
|
|
|
- } else {
|
|
|
- if ($form->wage!=0) {
|
|
|
- $wage = explode('~', format_wage(get_category($form->wage)));
|
|
|
- if (isset($wage[1])) {
|
|
|
- $form->wage_max = $wage[1];
|
|
|
- }
|
|
|
- $form->wage_min = $wage[0];
|
|
|
- } else {
|
|
|
- if ($form->wage_min < config('aix.companyset.comset.com_set.wage_min')) {
|
|
|
- $error = new MessageBag([
|
|
|
- 'title' => '提示',
|
|
|
- 'message' => '最低薪资请填写大于'.config('aix.companyset.comset.com_set.wage_min'),
|
|
|
- ]);
|
|
|
- return back()->with(compact('error'));
|
|
|
- }
|
|
|
- if ($form->wage_min%10 != 0) {
|
|
|
- $error = new MessageBag([
|
|
|
- 'title' => '提示',
|
|
|
- 'message' => '薪资请填写10的倍数',
|
|
|
- ]);
|
|
|
-
|
|
|
- return back()->with(compact('error'));
|
|
|
- }
|
|
|
- if ($form->wage_max%10 != 0) {
|
|
|
- $error = new MessageBag([
|
|
|
- 'title' => '提示',
|
|
|
- 'message' => '薪资请填写10的倍数',
|
|
|
- ]);
|
|
|
-
|
|
|
- return back()->with(compact('error'));
|
|
|
- }
|
|
|
- if (isset($form->wage_max) && $form->wage_max && $form->wage_max < $form->wage_min) {
|
|
|
- $error = new MessageBag([
|
|
|
- 'title' => '提示',
|
|
|
- 'message' => '最高薪资不能低于最低薪资',
|
|
|
- ]);
|
|
|
-
|
|
|
- return back()->with(compact('error'));
|
|
|
- }
|
|
|
- }
|
|
|
+ $form->wage_min = $wage[0];
|
|
|
+ } else {
|
|
|
+ if ($form->wage_min < config('aix.companyset.comset.com_set.wage_min')) {
|
|
|
+ $error = new MessageBag([
|
|
|
+ 'title' => '提示',
|
|
|
+ 'message' => '最低薪资请填写大于' . config('aix.companyset.comset.com_set.wage_min'),
|
|
|
+ ]);
|
|
|
+ return back()->with(compact('error'));
|
|
|
}
|
|
|
- if (($form->min_age && !$form->max_age) || ($form->max_age && !$form->min_age)) {
|
|
|
+ if ($form->wage_min % 10 != 0) {
|
|
|
$error = new MessageBag([
|
|
|
'title' => '提示',
|
|
|
- 'message' => '请同时填写最高和最低年龄',
|
|
|
+ 'message' => '薪资请填写10的倍数',
|
|
|
]);
|
|
|
|
|
|
return back()->with(compact('error'));
|
|
|
}
|
|
|
- if ($form->min_age && $form->min_age < 16) {
|
|
|
+ if ($form->wage_max % 10 != 0) {
|
|
|
$error = new MessageBag([
|
|
|
'title' => '提示',
|
|
|
- 'message' => '最低年龄不能小于16岁',
|
|
|
+ 'message' => '薪资请填写10的倍数',
|
|
|
]);
|
|
|
|
|
|
return back()->with(compact('error'));
|
|
|
}
|
|
|
- if ($form->max_age && $form->min_age > 65) {
|
|
|
+ if (isset($form->wage_max) && $form->wage_max && $form->wage_max < $form->wage_min) {
|
|
|
$error = new MessageBag([
|
|
|
'title' => '提示',
|
|
|
- 'message' => '最高年龄不能大于65岁',
|
|
|
+ 'message' => '最高薪资不能低于最低薪资',
|
|
|
]);
|
|
|
|
|
|
return back()->with(compact('error'));
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (($form->min_age && !$form->max_age) || ($form->max_age && !$form->min_age)) {
|
|
|
+ $error = new MessageBag([
|
|
|
+ 'title' => '提示',
|
|
|
+ 'message' => '请同时填写最高和最低年龄',
|
|
|
+ ]);
|
|
|
+
|
|
|
+ return back()->with(compact('error'));
|
|
|
+ }
|
|
|
+ if ($form->min_age && $form->min_age < 16) {
|
|
|
+ $error = new MessageBag([
|
|
|
+ 'title' => '提示',
|
|
|
+ 'message' => '最低年龄不能小于16岁',
|
|
|
+ ]);
|
|
|
|
|
|
+ return back()->with(compact('error'));
|
|
|
+ }
|
|
|
+ if ($form->max_age && $form->min_age > 65) {
|
|
|
+ $error = new MessageBag([
|
|
|
+ 'title' => '提示',
|
|
|
+ 'message' => '最高年龄不能大于65岁',
|
|
|
+ ]);
|
|
|
|
|
|
- if ($form->syqxz_min && $form->syqxz_min < $form->wage_min*0.8 ) {
|
|
|
- $error = new MessageBag([
|
|
|
- 'title' => '提示',
|
|
|
- 'message' => '试用期薪资不得低于正式工资的80%',
|
|
|
- ]);
|
|
|
+ return back()->with(compact('error'));
|
|
|
+ }
|
|
|
|
|
|
- return back()->with(compact('error'));
|
|
|
|
|
|
- }
|
|
|
- if($form->syq==367){//无试用期 就把工资清0
|
|
|
- $form->syqxz_min=null;
|
|
|
- }
|
|
|
+ if ($form->syqxz_min && $form->syqxz_min < $form->wage_min * 0.8) {
|
|
|
+ $error = new MessageBag([
|
|
|
+ 'title' => '提示',
|
|
|
+ 'message' => '试用期薪资不得低于正式工资的80%',
|
|
|
+ ]);
|
|
|
|
|
|
+ return back()->with(compact('error'));
|
|
|
+
|
|
|
+ }
|
|
|
+ if ($form->syq == 367) {//无试用期 就把工资清0
|
|
|
+ $form->syqxz_min = null;
|
|
|
+ }
|
|
|
|
|
|
- });
|
|
|
- $form->saved(function (Form $form) use ($id) {
|
|
|
- $province = \Illuminate\Support\Facades\Request::input('province');
|
|
|
- $city = \Illuminate\Support\Facades\Request::input('city');
|
|
|
- $area = \Illuminate\Support\Facades\Request::input('area');
|
|
|
- $district = $province.'.'.$city.'.'.$area;
|
|
|
- $age[] = \Illuminate\Support\Facades\Request::input('min_age');
|
|
|
- $age[] = \Illuminate\Support\Facades\Request::input('max_age');
|
|
|
-
|
|
|
- $age = implode('-', $age);
|
|
|
-
|
|
|
- $jobsData=session('jobsData');//记录修改前的数据
|
|
|
-
|
|
|
- if (!empty($jobsData)){
|
|
|
- if ($jobsData['audit'] != $form->model()->audit){//修改了审核状态
|
|
|
- //审核日志$reason
|
|
|
- $auditData= [];
|
|
|
- $auditData['ids'] = $id;
|
|
|
- $auditData['status'] = $form->model()->audit;
|
|
|
- $auditData['type'] = 3;
|
|
|
- $auditData['reason'] = "";
|
|
|
- AuditReason::addData($auditData);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- Jobs::where('id', $id)->update(['district'=>$district,'age'=>$age]);
|
|
|
-
|
|
|
-
|
|
|
- $subsites = \Illuminate\Support\Facades\Request::input('relate_subsites');
|
|
|
- if ($subsites) {
|
|
|
- $subsites = array_merge(array(get_subsite_id()), $subsites);
|
|
|
- SubsiteJob::where('jobs_id', $form->model()->id)->delete();
|
|
|
- $set_data = array();
|
|
|
- foreach ($subsites as $k => $v) {
|
|
|
- if ($v !== null) {
|
|
|
- $set_data[] = array(
|
|
|
- 'jobs_id' => $form->model()->id,
|
|
|
- 'subsite_id'=> $v,
|
|
|
- 'created_at'=> date('Y-m-d H:i:s'),
|
|
|
- 'updated_at'=> date('Y-m-d H:i:s'),
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- SubsiteJob::insert($set_data);
|
|
|
+ });
|
|
|
+ $form->saved(function (Form $form) use ($id) {
|
|
|
+ $province = \Illuminate\Support\Facades\Request::input('province');
|
|
|
+ $city = \Illuminate\Support\Facades\Request::input('city');
|
|
|
+ $area = \Illuminate\Support\Facades\Request::input('area');
|
|
|
+ $district = $province . '.' . $city . '.' . $area;
|
|
|
+ $age[] = \Illuminate\Support\Facades\Request::input('min_age');
|
|
|
+ $age[] = \Illuminate\Support\Facades\Request::input('max_age');
|
|
|
+
|
|
|
+ $age = implode('-', $age);
|
|
|
+
|
|
|
+ $jobsData = session('jobsData');//记录修改前的数据
|
|
|
+
|
|
|
+ if (!empty($jobsData)) {
|
|
|
+ if ($jobsData['audit'] != $form->model()->audit) {//修改了审核状态
|
|
|
+ //审核日志$reason
|
|
|
+ $auditData = [];
|
|
|
+ $auditData['ids'] = $id;
|
|
|
+ $auditData['status'] = $form->model()->audit;
|
|
|
+ $auditData['type'] = 3;
|
|
|
+ $auditData['reason'] = "";
|
|
|
+ AuditReason::addData($auditData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Jobs::where('id', $id)->update(['district' => $district, 'age' => $age]);
|
|
|
+
|
|
|
+
|
|
|
+ $subsites = \Illuminate\Support\Facades\Request::input('relate_subsites');
|
|
|
+ if ($subsites) {
|
|
|
+ $subsites = array_merge([get_subsite_id()], $subsites);
|
|
|
+ SubsiteJob::where('jobs_id', $form->model()->id)->delete();
|
|
|
+ $set_data = [];
|
|
|
+ foreach ($subsites as $k => $v) {
|
|
|
+ if ($v !== null) {
|
|
|
+ $set_data[] = [
|
|
|
+ 'jobs_id' => $form->model()->id,
|
|
|
+ 'subsite_id' => $v,
|
|
|
+ 'created_at' => date('Y-m-d H:i:s'),
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s'),
|
|
|
+ ];
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ SubsiteJob::insert($set_data);
|
|
|
+ }
|
|
|
+ });
|
|
|
return $form;
|
|
|
}
|
|
|
+
|
|
|
public function update($id)
|
|
|
{
|
|
|
|
|
@@ -767,9 +772,8 @@ ETO;
|
|
|
event_search_update(Jobs::class, (string)$id, 'update');
|
|
|
|
|
|
|
|
|
-
|
|
|
- $cids = Jobs::where('id', $id)->pluck('company_id')->toArray();
|
|
|
- $company_condition = [['whereIn','id', $cids]];
|
|
|
+ $cids = Jobs::where('id', $id)->pluck('company_id')->toArray();
|
|
|
+ $company_condition = [['whereIn', 'id', $cids]];
|
|
|
event_search_update(Company::class, $company_condition, 'update');
|
|
|
|
|
|
return $result;
|
|
@@ -781,12 +785,12 @@ ETO;
|
|
|
if (!$ids) {
|
|
|
return admin_toastr('请选择要审核的职位', 'error');
|
|
|
}
|
|
|
- $id = explode(',', $ids);
|
|
|
- $job_com_ids =$this->jobsRepository->findWhereIn('id', $id, ['company_id','id','jobs_name'])->toArray();
|
|
|
+ $id = explode(',', $ids);
|
|
|
+ $job_com_ids = $this->jobsRepository->findWhereIn('id', $id, ['company_id', 'id', 'jobs_name'])->toArray();
|
|
|
|
|
|
$reason = $request->reason;
|
|
|
- $audit = $request->audit1;
|
|
|
- $data = ['audit'=>$audit];
|
|
|
+ $audit = $request->audit1;
|
|
|
+ $data = ['audit' => $audit];
|
|
|
if (Jobs::jobsUpdate($id, $data)) {
|
|
|
event_search_update(Jobs::class, implode(',', $id), 'update');
|
|
|
|
|
@@ -795,17 +799,17 @@ ETO;
|
|
|
foreach ($company_ids as $k => $c) {
|
|
|
$company_ids[] = $c['company_id'];
|
|
|
}
|
|
|
- $company_condition = [['whereIn','id', $company_ids]];
|
|
|
+ $company_condition = [['whereIn', 'id', $company_ids]];
|
|
|
event_search_update(Company::class, $company_condition, 'update');
|
|
|
}
|
|
|
switch ($request->audit1) {
|
|
|
case 1:
|
|
|
- $html = "通过审核";
|
|
|
- $alias=Smser::TEMPLATE_SMS_JOBSALLOW;
|
|
|
+ $html = "通过审核";
|
|
|
+ $alias = Smser::TEMPLATE_SMS_JOBSALLOW;
|
|
|
break;
|
|
|
case 3:
|
|
|
- $html = "未通过审核";
|
|
|
- $alias=Smser::TEMPLATE_SMS_JOBSNOTALLOW;
|
|
|
+ $html = "未通过审核";
|
|
|
+ $alias = Smser::TEMPLATE_SMS_JOBSNOTALLOW;
|
|
|
|
|
|
break;
|
|
|
}
|
|
@@ -833,18 +837,18 @@ ETO;
|
|
|
foreach ($id as $key => $val) {
|
|
|
$jobsInfo = Jobs::with('jobsContact')->find($val);
|
|
|
if ($jobsInfo->jobsContact && $jobsInfo->jobsContact->telephone) {
|
|
|
- if(!in_array($jobsInfo->jobsContact->telephone, $mobile)){
|
|
|
+ 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')]);
|
|
|
+ $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')]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//审核日志$reason
|
|
|
- $auditData= [];
|
|
|
- $auditData['ids'] = $id;
|
|
|
+ $auditData = [];
|
|
|
+ $auditData['ids'] = $id;
|
|
|
$auditData['status'] = $audit;
|
|
|
- $auditData['type'] = 3;
|
|
|
+ $auditData['type'] = 3;
|
|
|
$auditData['reason'] = $reason;
|
|
|
AuditReason::addData($auditData);
|
|
|
if ($request->is_send) {
|
|
@@ -852,29 +856,29 @@ ETO;
|
|
|
$insertData = [];
|
|
|
|
|
|
foreach ($job_com_ids as $key => $val) {
|
|
|
- $insertData[$key] = array(
|
|
|
+ $insertData[$key] = [
|
|
|
'utype' => 1,
|
|
|
'msgtype' => 1,
|
|
|
'msgfromuid' => admin::user()->id,
|
|
|
- 'msgfrom' => admin::user()->username,
|
|
|
- '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()),
|
|
|
- );
|
|
|
+ 'msgfrom' => admin::user()->username,
|
|
|
+ '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);
|
|
|
}
|
|
|
- if($request->type) {
|
|
|
+ if ($request->type) {
|
|
|
admin_toastr('职位审核成功', 'success');
|
|
|
return back();
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
return admin_toastr('职位审核成功', 'success');
|
|
|
}
|
|
|
} else {
|
|
|
- if($request->type) {
|
|
|
+ if ($request->type) {
|
|
|
admin_toastr('职位审核失败', 'error');
|
|
|
return back();
|
|
|
} else {
|
|
@@ -885,7 +889,7 @@ ETO;
|
|
|
|
|
|
public function jobsbusiness(Content $content)
|
|
|
{
|
|
|
- return $content->body(view(admin_base_path().'/jobsbusiness/jobs_business'));
|
|
|
+ return $content->body(view(admin_base_path() . '/jobsbusiness/jobs_business'));
|
|
|
}
|
|
|
|
|
|
public function jobsrefresh(Request $request)
|
|
@@ -894,14 +898,14 @@ ETO;
|
|
|
if (!$ids) {
|
|
|
return admin_toastr('请选择要刷新的职位', 'error');
|
|
|
}
|
|
|
- $id = explode(',', $ids);
|
|
|
+ $id = explode(',', $ids);
|
|
|
$data = ['refresh_time' => time()];
|
|
|
|
|
|
if (Jobs::jobsUpdate($id, $data)) {
|
|
|
event_search_update(Jobs::class, implode(',', $id), 'update');
|
|
|
|
|
|
- $com_ids =$this->jobsRepository->findWhereIn('id', $id, ['company_id'])->toArray();
|
|
|
- $company_condition = [['whereIn','id', $com_ids]];
|
|
|
+ $com_ids = $this->jobsRepository->findWhereIn('id', $id, ['company_id'])->toArray();
|
|
|
+ $company_condition = [['whereIn', 'id', $com_ids]];
|
|
|
event_search_update(Company::class, $company_condition, 'update');
|
|
|
|
|
|
return admin_toastr('职位刷新成功', 'success');
|
|
@@ -916,7 +920,7 @@ ETO;
|
|
|
$ids = explode(',', $id);
|
|
|
|
|
|
$company_id = Jobs::select('company_id')->whereIn('id', $ids)->get()->toArray();
|
|
|
- $cids = array();
|
|
|
+ $cids = [];
|
|
|
if ($company_id) {
|
|
|
foreach ($company_id as $k => $v) {
|
|
|
$cids[] = $v['company_id'];
|
|
@@ -936,9 +940,9 @@ ETO;
|
|
|
if (false === ViewJob::whereIn('job_id', $ids)->delete()) {
|
|
|
throw new \Exception('职位被浏览信息删除失败,删除职位失败!');
|
|
|
}
|
|
|
- $condition = [['whereIn','id',$ids]];
|
|
|
+ $condition = [['whereIn', 'id', $ids]];
|
|
|
event_search_update(Jobs::class, $condition, 'delete');
|
|
|
- $company_condition = [['whereIn','id', $cids]];
|
|
|
+ $company_condition = [['whereIn', 'id', $cids]];
|
|
|
event_search_update(Company::class, $company_condition, 'update');
|
|
|
DB::commit();
|
|
|
} catch (\Exception $e) {
|
|
@@ -950,29 +954,29 @@ ETO;
|
|
|
|
|
|
public function auditLog(Request $request)
|
|
|
{
|
|
|
- $id = $request->id;
|
|
|
- $type = $request->type;
|
|
|
- $headers = ['status'=>'审核状态', 'tim'=>'审核时间', 'sec'=>'描述'];
|
|
|
- $data = [];
|
|
|
- $res = AuditReason::where(['type_id'=>$id,'type'=>$type])->orderBy('id', 'desc')->get();
|
|
|
+ $id = $request->id;
|
|
|
+ $type = $request->type;
|
|
|
+ $headers = ['status' => '审核状态', 'tim' => '审核时间', 'sec' => '描述'];
|
|
|
+ $data = [];
|
|
|
+ $res = AuditReason::where(['type_id' => $id, 'type' => $type])->orderBy('id', 'desc')->get();
|
|
|
if (!$res) {
|
|
|
$rows = $data;
|
|
|
} else {
|
|
|
foreach ($res as $k => $v) {
|
|
|
- if ($v['status']==3) {
|
|
|
+ if ($v['status'] == 3) {
|
|
|
$data[$k]['status'] = '审核失败';
|
|
|
- } elseif ($v['status']==1) {
|
|
|
+ } elseif ($v['status'] == 1) {
|
|
|
$data[$k]['status'] = '审核通过';
|
|
|
} else {
|
|
|
$data[$k]['status'] = '待审核';
|
|
|
}
|
|
|
$data[$k]['tim'] = $v['created_at'];
|
|
|
- $data[$k]['sec'] = $v['audit_man'].'--'.$v['reason'];
|
|
|
+ $data[$k]['sec'] = $v['audit_man'] . '--' . $v['reason'];
|
|
|
}
|
|
|
$rows = $data;
|
|
|
}
|
|
|
|
|
|
$table = new Table($headers, $rows);
|
|
|
- return ['html'=>$table->render(),'detail'=>'审核日志'];
|
|
|
+ return ['html' => $table->render(), 'detail' => '审核日志'];
|
|
|
}
|
|
|
}
|