From 17a84b66d010eaa7488cf4f06fa4559860465ab2 Mon Sep 17 00:00:00 2001 From: heshupeng <hsp@bronet.cn> Date: Fri, 22 Jan 2021 21:54:29 +0800 Subject: [PATCH] 求职招聘时间 --- application/mobile/controller/CompanyJob.php | 12 ++++++++++-- application/mobile/controller/UserJob.php | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/application/mobile/controller/CompanyJob.php b/application/mobile/controller/CompanyJob.php index 7bba72d..88cef33 100644 --- a/application/mobile/controller/CompanyJob.php +++ b/application/mobile/controller/CompanyJob.php @@ -247,8 +247,16 @@ class CompanyJob extends Api $post = $this->request->param(); empty($post['name']) && $this->error('请输入岗位名称'); empty($post['type']) && $this->error('请选择岗位类型'); - empty($post['start_time']) && $this->error('请选择开始工作日期'); - empty($post['end_time']) && $this->error('请选择结束工作日期'); + if($post['type'] == '2'){ + empty($post['start_time']) && $this->error('请选择开始工作日期'); + empty($post['end_time']) && $this->error('请选择结束工作日期'); + } + if(!empty($post['start_time'])){ + $post['start_time'] = strtotime($post['start_time']); + } + if(!empty($post['end_time'])){ + $post['end_time'] = strtotime($post['end_time']); + } empty($post['salary']) && $this->error('请输入薪资待遇'); empty($post['address']) && $this->error('请输入工作地点'); empty($post['lng']) && $this->error('请输入工作地点经度'); diff --git a/application/mobile/controller/UserJob.php b/application/mobile/controller/UserJob.php index e51ae20..ed57654 100644 --- a/application/mobile/controller/UserJob.php +++ b/application/mobile/controller/UserJob.php @@ -228,8 +228,16 @@ class UserJob extends Api empty($post['name']) && $this->error('请输入岗位名称'); empty($post['type']) && $this->error('请选择岗位类型'); empty($post['mobile']) && $this->error('请输入手机号'); - empty($post['start_time']) && $this->error('请选择开始工作日期'); - empty($post['end_time']) && $this->error('请选择结束工作日期'); + if($post['type'] == '2'){ + empty($post['start_time']) && $this->error('请选择开始工作日期'); + empty($post['end_time']) && $this->error('请选择结束工作日期'); + } + if(!empty($post['start_time'])){ + $post['start_time'] = strtotime($post['start_time']); + } + if(!empty($post['end_time'])){ + $post['end_time'] = strtotime($post['end_time']); + } empty($post['salary']) && $this->error('请输入薪资待遇'); empty($post['address']) && $this->error('请输入期望工作地点'); empty($post['user_job_ability_ids']) && $this->error('请选择资质能力'); -- libgit2 0.24.0