public function get_job_list() { $page = $_POST['page']; $size = $_POST['number']; $start = ($page - 1) * $size; $mOb = new JobModel(); $num = $mOb->new_job_count(); //得到列表总条数 $limit = "{$start},{$size}"; //每页的数据数和内容$limit $result = $mOb->new_job_list($limit); if (empty($result)) { $result = array(); } $data = array('count' => $num, 'result' => $result); echo json_encode($data); }
public function get_job_list() { $page = $_POST['page']; $size = $_POST['number']; $title = $_POST['condition']; $start = ($page - 1) * $size; $mOb = new JobModel(); $num = intval($mOb->new_job_count($title)); //得到列表总条数 $limit = "{$start},{$size}"; $result = $mOb->new_job_list($limit, $title); //得到职位列表 // echo "<pre>";var_dump($result);echo "</pre>"; if (empty($result)) { $result = array(); } // foreach ($result as &$v) { // unset($v['content']); // unset($v['workdesc']); // unset($v['softlytip']); // unset($v['jobbright']); // unset($v['email']); // unset($v['match_company']); // unset($v['match_title']); // unset($v['match_skill']); // unset($v['match_industry']); // unset($v['is_match']); // unset($v['orderid']); // unset($v['joblang']); // unset($v['checkinfo']); // unset($v['is_deleted']); // unset($v['newstatus']); // unset($v['is_view']); // unset($v['meth']); // unset($v['expertid']); // unset($v['report']); // } $data = array('count' => $num, 'result' => $result); echo json_encode($data); }