How to write the query in yii,using findAll()

后端 未结 3 1446
名媛妹妹
名媛妹妹 2021-01-28 23:27

I have the following sql query, how can I write the query in yii using findAll()?

I am not using CDbCriteria and for the time being avoiding i

3条回答
  •  别那么骄傲
    2021-01-28 23:47

    you can use queryAll with create command.

        $query= " SELECT * 
        FROM job_profile
        INNER JOIN user ON user.id = job_profile.user_id
        INNER JOIN category ON category.id = job_profile.category_id
        WHERE category_id =1
        AND experience =2
        AND key_skills LIKE  '%php%'";
    
                    $result= Yii::app()->db->createCommand($query)->queryAll();
    

提交回复
热议问题