thinkphp關聯查詢

weixin_34377065發表於2014-04-15
$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();

  

相關文章