Changeset 20792
- Timestamp:
- 2011/03/29 16:45:10 (12 years ago)
- Location:
- branches/version-2_11-dev/data/class
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php
r20783 r20792 181 181 SUM(total) AS total, 182 182 AVG(total) AS total_average"; 183 } 184 185 /** 186 * 売上集計の年代別集計の年代抽出部分のSQLを返す 187 * 188 * @return string 年代抽出部分の SQL 189 */ 190 function getOrderTotalAgeColSql() { 191 return 'TRUNC((YEAR(create_date) - YEAR(order_birth)) - (RIGHT(create_date, 5) < RIGHT(order_birth, 5)), -1)'; 183 192 } 184 193 -
branches/version-2_11-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php
r20764 r20792 164 164 SUM(total) AS total, 165 165 AVG(total) AS total_average"; 166 } 167 168 /** 169 * 売上集計の年代別集計の年代抽出部分のSQLを返す 170 * 171 * @return string 年代抽出部分の SQL 172 */ 173 function getOrderTotalAgeColSql() { 174 return 'TRUNC(CAST(EXTRACT(YEAR FROM AGE(create_date, order_birth)) AS INT), -1)'; 166 175 } 167 176 -
branches/version-2_11-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php
r20764 r20792 614 614 list($where, $arrval) = $this->lfGetWhereMember('create_date', $sdate, $edate, $type); 615 615 616 if (DB_TYPE == 'pgsql') { 617 $col = ' 618 TRUNC(CAST(EXTRACT(YEAR FROM AGE(create_date, order_birth)) AS INT), -1) AS age, 619 '; 620 } else { 621 $col = ' 622 trunc((YEAR(create_date) - YEAR(order_birth)) - (RIGHT(create_date, 5) < RIGHT(order_birth, 5)), -1) as age, 623 '; 624 } 625 626 $col .= ' 616 $dbFactory = SC_DB_DBFactory_Ex::getInstance(); 617 $col = $dbFactory->getOrderTotalAgeColSql() . ' AS age, 627 618 COUNT(order_id) AS order_count, 628 619 SUM(total) AS total,
Note: See TracChangeset
for help on using the changeset viewer.