Changeset 20242


Ignore:
Timestamp:
2011/02/20 07:04:03 (10 years ago)
Author:
shutta
Message:

refs #1013
年代別集計のPostgreSQLでのエラーを修正。
ただ、集計結果が、年代別ではなく年齢別になっちゃってる。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php

    r20241 r20242  
    592592        list($where, $arrval) = $this->lfGetWhereMember('create_date', $sdate, $edate, $type); 
    593593 
    594         // todo postgres 
    595         $col    = ' 
    596             trunc((YEAR(create_date) - YEAR(order_birth)) - (RIGHT(create_date, 5) < RIGHT(order_birth, 5)), -1) as age, 
     594        if (DB_TYPE == 'pgsql') { 
     595            $col = ' 
     596                EXTRACT(YEAR FROM AGE(create_date, order_birth)) AS age, 
     597                '; 
     598        } else { 
     599            $col = ' 
     600                trunc((YEAR(create_date) - YEAR(order_birth)) - (RIGHT(create_date, 5) < RIGHT(order_birth, 5)), -1) as age, 
     601                '; 
     602        } 
     603 
     604        $col .= ' 
    597605            COUNT(order_id) AS order_count, 
    598606            SUM(total) AS total, 
Note: See TracChangeset for help on using the changeset viewer.