Index: temp/trunk/html/admin/batch/daily.php
===================================================================
--- temp/trunk/html/admin/batch/daily.php	(revision 4980)
+++ temp/trunk/html/admin/batch/daily.php	(revision 4981)
@@ -238,7 +238,9 @@
 		$where = $base_where . " AND order_birth >= cast('$start_date' as date)";
 		$start_age = $i * 10;
-		$end_age = $start_age+9;
 		if($i <= $age_loop) {
+			$end_age = $start_age+9;
 			$where = $where . " AND order_birth <= cast('$end_date' as date)";
+		}else{
+			$end_age = 999;
 		}
 		lfBatOrderAgeSub($sql . $where, $start, $end, $start_age, $end_age, 1);
@@ -282,6 +284,5 @@
 	
 	if($start_age != NULL || $end_age != NULL) {
-//		$arrRet = $objQuery->getall($sql, array($start, $end, $start_age, $end_age));
-		$arrRet = $objQuery->getall($sql, array($start, $end));
+		$arrRet = $objQuery->getall($sql, array($start, $end, $start_age, $end_age));
 	} else {
 		$arrRet = $objQuery->getall($sql, array($start, $end));
