worker->id; $comjobsid = input('id/d', 0); $comjobs = ComjobsModel::field([ 'id', 'title', 'cateid', 'address', 'agegroup', 'tags', 'comdetails', 'requirement', 'companydetails', 'wtype', 'zwagall', 'recruit_num', 'telephone', 'remark', 'picall', ])->where('workerid', '=', $workerid)->where('id', '=', $comjobsid)->find(); if (empty($comjobs)) { $comjobs = "{cateid:0}"; } else { $comjobs->tags = implode(",", $comjobs->tags); } $catelist = ComjobsCateModel::field('title as text,id')->order(['priority' => 'desc', 'id' => 'desc'])->select(); return view('ejobs/form', [ 'job' => $comjobs, 'catelist' => $catelist, ]); } public function formPost() { $post = $this->request->post(); $post['tags'] = explode(",", $post['tags']); $post['status'] = 2; $post['updatetime'] = time(); $post['picall'] = empty($post['picall']) ? [] : $post['picall']; if (empty($post['id'])) { $post['workerid'] = $this->worker->id; $post['priority'] = 0; $post['province'] = '福建省'; $item['city'] = '福州市'; $item['district'] = '马尾区'; $post['bwagall'] = $post['zwagall']; $post['emp_time'] = []; $post['createtime'] = time(); ComjobsModel::create($post); } else { ComjobsModel::update($post, ['id' => $post['id'], 'workerid' => $this->worker->id]); } page_result(0, ""); } public function job() { return view('ejobs/job', [ 'status' => $this->request->get('status', 0), ]); } public function listJob() { $page = input('page/d', 1); $size = input('size/d', 20); $map = []; $workerid = $this->worker->id; $map[] = ['workerid', '=', $workerid]; $status = input('status/d', 1); if (!empty($status)) { $map[] = ['status', '=', $status]; } $comjobsid = input('comjobsid/d', 0); if (!empty($comjobsid)) { $map[] = ['comjobsid', '=', $comjobsid]; } $orderby = ['createtime' => 'desc', 'id' => 'desc']; $list = ComjobsLogModel::with(['comjobs', 'user']) ->where($map) ->append(['status_text']) ->order($orderby) ->page($page) ->limit($size) ->select(); page_result(0, "", $list); } public function statusJob() { $id = $this->request->post('id'); $info = ComjobsModel::where('id', $id)->where('workerid', $this->worker->id)->find(); if (empty($info)) { page_result(1, "岗位不存在"); } if ($info['status'] < 3) { page_result(1, "请等待后台审核"); } $info->status = $this->request->post('status'); $info->save(); page_result(0, ""); } }