$db = M("sys_news"); if ($_GET[id]==""){ //获得默认id $content=$db->where("f_section like 'B02%'")->order("f_section")->find(); $_GET[id]=$content[id]; }else{ $content=$db->where("id=".$_GET[id])->find(); } // echo $db->getlastsql();exit; $db=M("sys_wordbook"); $list=$db->where("f_code like 'B02%' and length(f_code)=5")->select(); $db=M("sys_news"); foreach ($list as &$tmp){ $tmp[son]=$db->where("f_section='".$tmp[f_code]."' and f_status=0")->order("f_sort,id")->select(); } //dump($list);exit;

{$content.f_title}

{$content.f_content}