$m=M('Diary');
$where['userid']=$_SESSION['userid'];
$list=$m
->join(array('rj_type on rj_type.typeid=rj_diary.typeid '))
->where(array('userid'=>$where))
->select();数据库:diary表 :diaryid,userid,typeid,theme,content
type表 :typeid,userid,privary,typename
想通过本两个表匹配typeid,但是需要userid区分查询的用户。怎么写?