尝试这样的事情
public function joinWithI18nFallback($locale=null, $joinType = Criteria::LEFT_JOIN, $default_locale=null)
{
$languages = sfConfig::get('sf_languages');
if(null == $locale)
{
$locale = sfPropel::getDefaultCulture();
}
if(null == $default_locale)
{
$default_locale = sfPropel::getDefaultCulture();
}
$languages[] = $locale;
$languages[] = $default_locale;
$languages = array_unique($languages);
$FallbackQuery = CategoryQuery::create()
->leftJoin('CategoryI18n')
->addJoinCondition('CategoryI18n', "CategoryI18n.Culture IN ('".implode("','", $languages)."')" )
->withColumn('CategoryI18n.Culture', 'CultureDefault')
->addAscendingOrderByColumn("FIELD(category_i18n.culture, '".$locale."', '".implode("','", $languages)."' )")
->where("CategoryI18n.name != ''");
$this->addSelectQuery($FallbackQuery, 'Category')
->join('CategoryI18n', $joinType)
->addJoinCondition('CategoryI18n', 'CategoryI18n.Culture = Category.CultureDefault' )
->with('CategoryI18n')
->groupById();
$this->with['CategoryI18n']->setIsWithOneToMany(false);
return $this;
}