如果使用sql语句做的话 工作量太大了,于是尝试自己写一个交叉表的类,好二话不说,我们看看代码 复制代码 代码如下: /** * 基本交叉表 * @author hugh * */ class Pivot { private $HORIZONTAL_TOTAL_FIELD = ‘total’; private $VERTICAL_TOTAL_FIELD = ‘total’; private $data; private $topPivot; private $leftPivot; private $measure; private $horizontalColumn = array (); p