thinkphp关联查询

$list=$model->table("$dName d ,$mName m,$cName c")
            ->field('d.*,m.title as musicTitle,m.hit as hit,m.down as down,m.likes as `like`,m.user_id as ownerId,c.name as categoryName')
            ->where(array(
                "d.user_id=".$userId,
                'd.info_id=m.id',
                'm.category=c.id'
            ))
            ->order('d.crdate desc')
            ->limit($Page->firstRow . ',' . $Page->listRows)
            ->select();

  

posted @ 2014-04-15 16:08  天道酬勤,坚持!  阅读(200)  评论(0编辑  收藏  举报