class EmptyAction extends Action {
function index() {
//echo MODULE_NAME;
$Sort=M('Sort');
$url="'".strtolower(MODULE_NAME)."'";//这里获取到about
$routaction=$Sort->where('url='.$url)->field('pointmodule,pointsort,showtype')->find();//根据url差不此url指向的模块,id,和显示方式
//print_r($routaction);
$rout=$routaction['pointmodule'];
$child=$Sort->where('pid='.$routaction['pointsort'])->field('id')->select();//查询子类
if(!empty($child)){//如果有子类,则获取说有子类的id,共文章查询显示
foreach($child as $v){
$sorts.=$v['id'].',';
}
}else{
$sorts=$routaction['pointsort'];
}
switch ($rout) {
case "Archive":
if($_GET['id']){
R('Archive/detail');
echo 'aaa';
}
if($routaction['showtype'] == 0){
R('Archive/ypdetail',array($sorts));
}//单页
elseif($routaction['showtype'] == 1){//列表
R('Archive/index',array($sorts));
}else{
echo '路由错误...';
}
break;
case "Product":
echo "Product";
break;
}
}
} 最佳答案