当我尝试使用关注代码获取名为Serviceinfo.services
$conditions = array('fields'=>array('SUM(Serviceinfo.services) as servicecount'),'conditions'=>array('time_id BETWEEN ? AND ?'=>array($startid,$endtid)));
$services = $this->Serviceinfo->find('all',$conditions);
我必须使用services[0][0]['servicecount']
获取和数据,这看起来有点奇怪。我期望的是services['Serviceinfo']['servicecount']
,或更简单的那个。那我怎么能解决这个问题?提前谢谢!< / p>
答案 0 :(得分:1)
答案 1 :(得分:0)
尝试为:
'SUM(Serviceinfo.services) as Serviceinfo.servicecount'