assign("orderby",$orderby); $smarty->assign("ordersort",$ordersort); $smarty->assign("pagerows",$pagerows); $ptype = $_GET['ptype']?$_GET['ptype']:1; if(preg_match('/^([0-9]*)$/',$_GET['id'])) $id = $_GET['id']; $now = date('Y-m-d'); $row = $Advert->listAll(" R.StartDate<='$now' and R.EndDate>='$now' and I.DisplayStatus = 'Y' and R.IsDel ='N' and I.IsDel ='N' ",$orderby,$ordersort,$Advert->table_rday." as R inner join ".$Advert->table_rday_info." as I on R.ID = I.DayID left join ".$Advert->table_user_em_detail." as D on R.EmID = D.EmID left join ".$Advert->table_user_em." as U on R.EmID = U.ID ","I.*,R.ID as ID2,R.EmID,PicS,PicB,R.IsHome,R.StartDate,R.EndDate,R.StartDateDesc,R.StartHour,R.StartMin,R.StartArea,R.EndHour,R.EndMin,R.EndArea,U.UserCode as UserID2,ECname,CCname,PageID,U.ParentID"); //得到有多少的搜索月份 $reseachMonth = array(); $reseachMonth2 = array(); foreach($row as $k=>$v){ $tempMonth = date('Y-m',strtotime($v['StartDateDesc'])); if(!in_array($tempMonth,$reseachMonth) && ($tempMonth ==date('Y-m') || $tempMonth == date('Y-m',strtotime('-1 month')) || $tempMonth == date('Y-m',strtotime('-2 month')))){ $reseachMonth[] = $tempMonth; $reseachMonth2[] = $Sys_MonthList[$langType][date('n',strtotime($v['StartDateDesc']))]; } } $smarty -> assign("reseachMonth", array_reverse($reseachMonth)); $smarty -> assign("reseachMonth2",array_reverse($reseachMonth2)); //搜索 $whereStr =""; $whereStr .= $_GET['startMonth']?" and left(R.StartDateDesc,7) = '".trim($_GET['startMonth'])."' ":""; //招聘日 $relist = $Advert->listPage(" R.StartDate<='$now' and R.EndDate>='$now' and R.IsDel ='N' $whereStr",$orderby,$ordersort,$page,$pagerows,"R.ID as ID2,R.EmID,PicS,PicB,R.IsHome,R.StartDate,R.EndDate,R.StartDateDesc,R.EndDateDesc,R.StartHour,R.StartMin,R.StartArea,R.EndHour,R.EndMin,R.EndArea,U.UserCode as UserID2,ECname,CCname,PageID,U.ParentID,LogoPic",'',$Advert->table_rday." as R left join ".$Advert->table_user_em_detail." as D on R.EmID = D.EmID left join ".$Advert->table_user_em." as U on R.EmID = U.ID "); foreach($relist as $k => $v){ $relist[$k]['jobNums'] = $Job->sumJobNums("job.CompanyID = ".$v['EmID']." and job.Status = 'Active'"); if($v['EndDateDesc'] == '0000-00-00'){ $relist[$k]['EndDateDesc'] = ''; } if(!$v['PicS']){ $relist[$k]['PicS'] = '/Upload/CompanyLogo/thumb_200/'.$v['LogoPic']; } $reInfolist = $Advert->listAll(" I.DisplayStatus = 'Y' and I.IsDel ='N' and DayID = ".$v['ID2'],'ID','asc',$Advert->table_rday_info." as I","I.*"); foreach($reInfolist as $k2 =>$v2){ $reInfolist[$k2]['Address'] = $Address->linkAddress($v2['Street'],$v2['StreetNo'],$v2['Building'],$v2['RoomNo']); if($v2['LocationID']){ $reInfolist[$k2]['Address'] = $AreaInfo[$langType][$v2['LocationID']]['Name'].$reInfolist[$k2]['Address']; } } $relist[$k]['Infos'] = $reInfolist; } $Advert->addPvNum($Advert->table_rday,$relist); $smarty -> assign("relist", $relist); $smarty -> assign("pageList", $Advert->pages); $smarty -> assign("id", $id); $smarty -> assign("ptype", $ptype); $smarty -> assign("startMonth", $_GET['startMonth']); // $smarty->assign("tpl_page","recruitment_list.tpl"); $smarty->display("container.tpl"); ?>