"status","name"=>'审核状态',"value"=>array("1"=>"已审核","3"=>"未审核","2"=>"已过期")); $search_list[] = array("param"=>"time","name"=>'发布时间',"value"=>array('1'=>'今天','3'=>'最近三天','7'=>'最近七天','15'=>'最近半月','30'=>'最近一个月')); $this->yunset("search_list",$search_list); } function index_action(){ $this->set_search(); $OnceM = $this -> MODEL('once'); if($_GET['keyword']){ $keytype = intval($_GET['type']); $keyword = trim($_GET['keyword']); if($keytype == 2){ $where['title'] = array('like',$keyword); }elseif($keytype == 3){ $where['phone'] = array('like',$keyword); }elseif($keytype == 4){ $where['linkman'] = array('like',$keyword); }elseif($keytype == 5){ $where['companyname'] = array('like',$keyword); } $urlarr['keytype'] = $keytype; $urlarr['keyword'] = $keyword; } if($_GET['status']){ $status = intval($_GET['status']); if($status == 1){ $where['status'] = $status; $where['edate'] = array(">",time()); }elseif($status == 3){ $where['status'] = 0; $where['edate'] = array(">",time()); }elseif($status == 2){ $where['status'] = 0; $where['edate'] = array("<",time()); } $urlarr['status'] = $status; } if($_GET['time']){ if($_GET['time']=='1'){ $where['ctime'] = array('>=',strtotime('today')); }else{ $where['ctime'] = array('>=',strtotime('-'.intval($_GET['time']).' day')); } $urlarr['time'] = $_GET['time']; } $urlarr['page'] = '{{page}}'; $pageurl = Url($_GET['m'],$urlarr,'admin'); $pageM = $this -> MODEL('page'); $pages = $pageM -> pageList('once_job',$where,$pageurl,$_GET['page']); if($pages['total'] > 0){ //limit order 只有在列表查询时才需要 if($_GET['order']){ $where['orderby'] = $_GET['t'].','.$_GET['order']; $urlarr['order'] = $_GET['order']; $urlarr['t'] = $_GET['t']; }else{ $where['orderby'] = array('status,asc','id,desc'); } } $where['limit'] = $pages['limit']; $List = $OnceM -> getOnceList($where); $this -> yunset(array('rows'=>$List)); $this -> siteadmin_tpl(array('admin_once')); } //批量延期 function ctime_action(){ $OnceM = $this -> MODEL('once'); $return = $OnceM -> setOnceCtime($_POST['onceids'],array('endtime'=>$_POST['endtime'])); $this->ACT_layer_msg($return['msg'],$return['errcode'],$_SERVER['HTTP_REFERER']); } /* *获得职位详情 * */ function show_action(){ if($_GET['id']){ $OnceM = $this -> MODEL('once'); $id = intval($_GET['id']); $show = $OnceM -> getOnceInfo(array('id'=>$id)); $this->yunset("show",$show); } $this->siteadmin_tpl(array('admin_once_show')); } //审核功能 function status_action(){ $OnceM = $this -> MODEL('once'); $status = intval($_POST['status']); $return = $OnceM -> setOnceStatus($_POST['allid'],array('status'=>$status)); if($return){ echo $return['status'];die; } } //店铺展示 function ajax_action(){ $onceM = $this -> MODEL('once'); $id = intval($_GET['id']); $info = $onceM -> getOnceInfo(array('id'=>$id)); echo json_encode($info); } //查询修改信息 function edit_action(){ if($_GET['id']){ $OnceM = $this->MODEL('once'); $id = intval($_GET['id']); $row = $OnceM -> getOnceInfo(array('id'=>$id)); $this -> yunset('row',$row); } $CacheM = $this->MODEL('cache'); $CacheList = $CacheM->GetCache(array('city')); $this->yunset($CacheList); $this->siteadmin_tpl(array('admin_once_add')); } //保存修改信息 function save_action(){ $onceM = $this -> MODEL("once"); $edate = strtotime("+".(int)$_POST['edate']." days"); $post = array( 'title' => $_POST['title'], 'companyname' => $_POST['companyname'], 'linkman' => $_POST['linkman'], 'phone' => $_POST['phone'], 'provinceid' => $_POST['provinceid'], 'cityid' => $_POST['cityid'], 'three_cityid' => $_POST['three_cityid'], 'address' => $_POST['address'], 'require' => $_POST['require'], 'edate' => $edate, 'salary' => $_POST['salary'], 'password' => $_POST['password'], 'file' => $_FILES['file'], 'status' => 1 ); $data = array( 'id' => (int)$_POST['id'], 'post' => $post, 'type'=>'admin' ); $return = $onceM -> addOnceInfo($data,'admin'); if($return['errcode']==9){ $this->ACT_layer_msg($return['msg'],$return['errcode'],'index.php?m=admin_once'); }else{ $this->ACT_layer_msg($return['msg'],$return['errcode']); } } //删除功能 function del_action(){ $this->check_token(); $OnceM = $this -> Model('once'); $id = is_array($_GET['del']) ? $_GET['del'] : $_GET['id']; $return = $OnceM -> delOnce($id); $this->layer_msg($return['msg'],$return['errcode'],$return['layertype'],$_SERVER['HTTP_REFERER']); } function set_action(){ $this->siteadmin_tpl(array('admin_onceset')); } function onceset_action(){ $configM = $this -> MODEL("config"); foreach($_POST as $key=>$v){ $where['name'] = $key; $config = $configM -> getNum($where); if($config==false){ $data = array( 'name' => $key, 'config' => $v, ); $msg = $configM -> addInfo($data); }else{ $where['name'] = $key; $data = array( 'config' => $v, ); $msg = $configM -> upInfo($where,$data); } if(!$msg){ $this->web_config(); $this->ACT_layer_msg('操作失败!',8);die; } } $this->web_config(); $this->ACT_layer_msg('操作成功!',9); } function onceNum_action(){ $MsgNum = $this->MODEL('msgNum'); echo $MsgNum->onceNum(); } } ?>