我将如何在 yii 框架中编写以下查询
function Get_Services($user_id, $isResultSet = true){
$sql = $this->select()
->setIntegrityCheck(false)
->from(array('p' => 'phone_service'))
->join(array('u' => 'user_preferences'), 'u.phone_service_id = p.phone_service_id')
->where('u.user_preferences_name = ?', 'is_user_package_active')
->where('p.user_id = ?', $user_id);
if($isResultSet){
return $sql->query()->fetchAll();
}else{
return $sql;
}
}