0
我有一个快速问题。如何在Yii活动记录模型中使用MySQL AVG()查询并将pass作为字符串?这是我和我现在的代码查询,但还给我作为一个NULL阵列...Yii-Active Record将特定列的平均结果作为字符串返回
/**
* Gets topic average rating by comments
* @param int $topic_id the topic unique id
*
* @return int rate
*/
public static function WS_countAverageRating($topic_id){
return ExploreComment::model()->findAll(array('select'=>"AVG(rating)",'condition'=>"topic_id='".$topic_id."'"));
}
嗨队友...感谢您的帮助......我管理做到这一点的你的指导.... – 2014-09-07 05:03:51