yuntpl(array('admin/admin_baipin')); } function add_action(){ $jobM = $this->MODEL('job'); $comM = $this->MODEL('company'); $numwhere = array( 'state' => 1, 'sdate' => array('>', strtotime('last month')), 'r_status' => 1, 'pr' => array('>',0), 'exp' => array('>',0), 'provinceid'=> array('>',0), 'status' => 0 ); $total_count = $jobM->getJobNum($numwhere); $pre_count = 1999; $data = "\r\n"; $data = "\r\n"; $j = 1; $createcount = intval($total_count/$pre_count)+1; if($createcount>=10){ $createcount = 10; } for ($i=0;$i<$createcount;$i++){ $uids = $jobs = array(); $start = strval($i*$pre_count); $where = array( 'state' => 1, 'sdate' => array('>', strtotime('last month')), 'r_status' => 1, 'status' => 0, 'provinceid' => array('>',0), 'pr' => array('>',0), 'exp' => array('>',0), 'orderby' => 'lastupdate,desc', 'limit' => array($start,$pre_count) ); $joblist = $jobM->getList($where); $jobs = $joblist['list']; foreach ($jobs as $v){ $uids[] = $v['uid']; } if (!empty($uids)){ $com = $comM->getList(array('uid'=>array('in',pylode(',',$uids))),array('logo'=>1,'field'=>'`uid`,`address`,`content`')); foreach ($jobs as $k=>$v){ if ($v['welfare']){ $jobs[$k]['welfarename'] = $v['welfare']; } foreach ($com['list'] as $val){ if ($v['uid']==$val['uid']){ $jobs[$k]['com_logo'] = $val['com_logo']; $jobs[$k]['address'] = $val['address']; $jobs[$k]['content'] = str_replace(" ","",$val['content']); } } } } $show="\r\n"; $show.="\r\n"; foreach($jobs as $key=>$v){ $comurl = Url("company",array("c"=>'show',"id"=>$v['uid'])); $joburl = Url("job",array("c"=>'comapply',"id"=>$v['id'])); $wapjoburl = Url('wap',array("c"=>"job",'a'=>'comapply',"id"=>$v['id'])); $cityArr = isset($v['job_city_two']) ? $v['job_city_two'] : '不限'; $citythree = isset($v['job_city_three']) ? $v['job_city_three'] : '不限'; $v['edate'] = $v['lastupdate'] + 86400 * 60; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="always\r\n"; $show.="1.0\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="<![CDATA[".$v['name']."]]>\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="config['sy_webname']."]]>\r\n"; $show.="config['sy_weburl']."]]>\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; $show.="\r\n"; } $show.="\r\n"; $path = APP_PATH."/data/xml/".$j.".xml"; $fp = @fopen($path,"w"); @fwrite($fp,$show); @fclose($fp); if($j<=10){ $data.="\r\n"; $data.="".$this->config['sy_weburl']."/data/xml/".$j.".xml\r\n"; $data.="".date("Y-m-d")."\r\n"; $data.="\r\n"; } $j++; } $data.="\r\n"; $path = APP_PATH."/data/xml/baidu.xml"; $fp = @fopen($path,"w"); @fwrite($fp,$data); @fclose($fp); $this->MODEL('log')->addAdminLog("百度百聘生成成功"); $this->ACT_layer_msg('百度百聘生成成功',9,$_SERVER['HTTP_REFERER'],2,1); } } ?>