ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 10842


Ignore:
Timestamp:
Feb 24, 2009, 4:13:33 PM (11 years ago)
Author:
kiwa
Message:

#3210:PsotgreSQL8.3対応漏れ箇所を修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/modules/admin/lib/db_admin.php

    r10822 r10842  
    12101210    if ($month_flag) {
    12111211        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1212             $sql .= " and substr(r_datetime,1,7) = ? ";
     1212            $sql .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    12131213        } else {
    12141214            $sql .= " and left(r_datetime, 7) = ? ";
     
    12181218    } else {
    12191219        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1220             $sql .= " and substr(r_datetime,1,10) = ? ";
     1220            $sql .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    12211221        } else {
    12221222            $sql .= " and left(r_datetime,10) = ? ";
     
    13141314    if ($month_flag) {
    13151315        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1316             $sql .= " and substr(r_datetime,1,7) = ? ";
     1316            $sql .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    13171317        } else {
    13181318            $sql .= " and left(r_datetime, 7) = ? ";
     
    13211321    } else {
    13221322        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1323             $sql .= " and substr(r_datetime,1,10) = ? ";
     1323            $sql .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    13241324        } else {
    13251325            $sql .= " and left(r_datetime,10) = ? ";
     
    13531353    if ($month_flag) {
    13541354        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1355             $sql .= " and substr(r_datetime,1,7) = ? ";
     1355            $sql .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    13561356        } else {
    13571357            $sql .= " and left(r_datetime, 7) = ? ";
     
    13601360    } else {
    13611361        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1362             $sql .= " and substr(r_datetime,1,10) = ? ";
     1362            $sql .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    13631363        } else {
    13641364            $sql .= " and left(r_datetime,10) = ? ";
     
    14951495    if ($month_flag) {
    14961496        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1497             $sql .= " and substr(r_datetime,1,7) = ? ";
     1497            $sql .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    14981498        } else {
    14991499            $sql .= " and left(r_datetime, 7) = ? ";
     
    15021502    } else {
    15031503        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1504             $sql .= " and substr(r_datetime,1,10) = ? ";
     1504            $sql .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    15051505        } else {
    15061506            $sql .= " and left(r_datetime,10) = ? ";
     
    15351535    if ($month_flag) {
    15361536        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1537             $sql .= " and substr(r_datetime,1,7) = ? ";
     1537            $sql .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    15381538        } else {
    15391539            $sql .= " and left(r_datetime, 7) = ? ";
     
    15421542    } else {
    15431543        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1544             $sql .= " and substr(r_datetime,1,10) = ? ";
     1544            $sql .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    15451545        } else {
    15461546            $sql .= " and left(r_datetime,10) = ? ";
     
    18961896    if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    18971897        $sql = "SELECT ((date_part('year', now()) - birth_year)- " .
    1898             "cast(substring(CURRENT_DATE,'.....$')<(to_char(birth_month, '00') || '-' || to_char(birth_day, '00')) as int)) " .
     1898            "cast(to_char(CURRENT_DATE,'.....$')<(to_char(birth_month, '00') || '-' || to_char(birth_day, '00')) as int)) " .
    18991899            "AS age FROM c_member WHERE birth_year <> 0;";
    19001900    } else {
Note: See TracChangeset for help on using the changeset viewer.