最新消息: 新版网站上线了!!!

yii左关联的例子

 $criteria = new CDbCriteria();

        $criteria->join = 'LEFT JOIN {{data}} a ON a.id = t.id LEFT JOIN {{linkage}} c ON c.linkageid=a.citec';

        $criteria->condition='c.linkageid=3411 and t.status=99';

        $criteria->limit='6';

        $criteria->order='t.inputtime desc';

        $positions = Data::model()->findAll($criteria);
        //print_r($positions);
        $criteria = new CDbCriteria();

转载请注明:谷谷点程序 » yii左关联的例子