我的统计查询尝试不起作用。从 ModelA 的视图中,我试图查询 ModelB 以查找 ModelB 中状态等于“D”且 AttributeB 等于登录用户的属性 Number 的总数。
关系:
关系查询尝试:
'total' => array(self::STAT, 'TableB', 'TableAId', 'select'=>'SUM(Number)',
'condition'=>'Status="D" AND AttributeB='.Yii::app()->user->id),