作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

求职招聘时间

@@ -247,8 +247,16 @@ class CompanyJob extends Api @@ -247,8 +247,16 @@ class CompanyJob extends Api
247 $post = $this->request->param(); 247 $post = $this->request->param();
248 empty($post['name']) && $this->error('请输入岗位名称'); 248 empty($post['name']) && $this->error('请输入岗位名称');
249 empty($post['type']) && $this->error('请选择岗位类型'); 249 empty($post['type']) && $this->error('请选择岗位类型');
250 - empty($post['start_time']) && $this->error('请选择开始工作日期');  
251 - empty($post['end_time']) && $this->error('请选择结束工作日期'); 250 + if($post['type'] == '2'){
  251 + empty($post['start_time']) && $this->error('请选择开始工作日期');
  252 + empty($post['end_time']) && $this->error('请选择结束工作日期');
  253 + }
  254 + if(!empty($post['start_time'])){
  255 + $post['start_time'] = strtotime($post['start_time']);
  256 + }
  257 + if(!empty($post['end_time'])){
  258 + $post['end_time'] = strtotime($post['end_time']);
  259 + }
252 empty($post['salary']) && $this->error('请输入薪资待遇'); 260 empty($post['salary']) && $this->error('请输入薪资待遇');
253 empty($post['address']) && $this->error('请输入工作地点'); 261 empty($post['address']) && $this->error('请输入工作地点');
254 empty($post['lng']) && $this->error('请输入工作地点经度'); 262 empty($post['lng']) && $this->error('请输入工作地点经度');
@@ -228,8 +228,16 @@ class UserJob extends Api @@ -228,8 +228,16 @@ class UserJob extends Api
228 empty($post['name']) && $this->error('请输入岗位名称'); 228 empty($post['name']) && $this->error('请输入岗位名称');
229 empty($post['type']) && $this->error('请选择岗位类型'); 229 empty($post['type']) && $this->error('请选择岗位类型');
230 empty($post['mobile']) && $this->error('请输入手机号'); 230 empty($post['mobile']) && $this->error('请输入手机号');
231 - empty($post['start_time']) && $this->error('请选择开始工作日期');  
232 - empty($post['end_time']) && $this->error('请选择结束工作日期'); 231 + if($post['type'] == '2'){
  232 + empty($post['start_time']) && $this->error('请选择开始工作日期');
  233 + empty($post['end_time']) && $this->error('请选择结束工作日期');
  234 + }
  235 + if(!empty($post['start_time'])){
  236 + $post['start_time'] = strtotime($post['start_time']);
  237 + }
  238 + if(!empty($post['end_time'])){
  239 + $post['end_time'] = strtotime($post['end_time']);
  240 + }
233 empty($post['salary']) && $this->error('请输入薪资待遇'); 241 empty($post['salary']) && $this->error('请输入薪资待遇');
234 empty($post['address']) && $this->error('请输入期望工作地点'); 242 empty($post['address']) && $this->error('请输入期望工作地点');
235 empty($post['user_job_ability_ids']) && $this->error('请选择资质能力'); 243 empty($post['user_job_ability_ids']) && $this->error('请选择资质能力');