caipin 5 年之前
父节点
当前提交
bd4ceaa469

+ 13 - 7
protected/controller/ReceiptExtendController.php

@@ -2678,22 +2678,22 @@ class ReceiptExtendController extends DooController {
     		$list=$receiptDetail->getReceiptDetailByYear($cidIn,$year);
     		
     		$cidArray=explode(',', $cidIn);
-    		$data=array();
+    		$dataSummary=array();
     		foreach ($cidArray as $cak=>$cav){
-    			$data[$cav]=array();
+    			$dataSummary[$cav]=array();
     			for($month=1;$month<=12;$month++){
     				foreach ($aiList as $aik=>$aiv){
-    					$data[$cav][$month][$aiv['category']]=array();
+    					$dataSummary[$cav][$month][$aiv['category']]=array();
     				}
-    				$data[$cav][$month]['报销金额调整']=array();
+    				$dataSummary[$cav][$month]['报销金额调整']=array();
     			}
     		}
     		foreach ($list as $key=>$value){
-    			array_push($data[$value['cid']][$value['month']][$value['itemCategory']], $value);
+    			array_push($dataSummary[$value['cid']][$value['month']][$value['itemCategory']], $value);
     		}
     		
+    		//构建数据html
     		$cglist=$category->getCategoryInCid($cidIn);
-    		//展示html
     		//print_r($aiAllList);
     		foreach ($cglist as $cgk=>$value){
     			for($month=1;$month<=12;$month++){
@@ -2703,7 +2703,13 @@ class ReceiptExtendController extends DooController {
     			}
     		}
     		
-    		print_r($data);
+    		//构建栏目展示Html
+    		$sectionHtml='';
+    		foreach ($aiList as $key=>$value){
+    			$sectionHtml.='<th colspan="'.$value['itemCount'].'">'.$value['category'].'</th>';
+    		}
+    		
+    		print_r($sectionHtml);
     	}
     	
     	

+ 1 - 1
protected/model/accountItem.php

@@ -27,7 +27,7 @@ class accountItem extends DooModel {
 	 * 
 	 */
 	function getAccountItem(){
-		$sql = 'select category
+		$sql = 'select category,count(*) as itemCount
 				from ' . $this->_table . '
 						 GROUP BY category ORDER BY  aid ASC  ';
 		$query = Doo::db ()->query ( $sql );

文件差异内容过多而无法显示
+ 15 - 3
protected/view/receipt/receiptSummaryStatisticsByAgency.html