public function index(){
$cate = 1;
$query = M('Cate')->field('id')->where(array('id'=>$cate,'pid'=>$cate,'_logic'=>'OR'))->buildSql();//在一个表中获得栏目的id
$goods = M('Goods')->where('cate_id in ' . $query)->select(); //在另一个表获得属于这些栏目的文章
p($goods);
//$this->display();
}