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

Changeset 10783


Ignore:
Timestamp:
Feb 17, 2009, 6:48:48 PM (12 years ago)
Author:
kiwa
Message:

#3210:管理画面のPostgreSQL8.3対応の取り込み

File:
1 edited

Legend:

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

    r10781 r10783  
    11211121{
    11221122    if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1123         $sql = "SELECT substr(r_datetime::text,1,10) as ymd , count(*) as count" .
     1123        $sql = "SELECT to_char(r_datetime, 'YYYY-MM-DD') as ymd , count(*) as count" .
    11241124            " FROM c_access_log " .
    1125             " where substr(r_datetime::text,1,7) = ?" .
     1125            " where to_char(r_datetime, 'YYYY-MM') = ?" .
    11261126            " and ktai_flag = ? " .
    11271127            " group by ymd";
     
    13871387    if ($month_flag) {
    13881388        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1389             $where .= " and substr(r_datetime::text,1, 7) = ? ";
     1389            $where .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    13901390        } else {
    13911391            $where .= " and left(r_datetime, 7) = ? ";
     
    13941394    } else {
    13951395        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1396             $where .= " and substr(r_datetime::text,1,10) = ? ";
     1396            $where .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    13971397        } else {
    13981398            $where .= " and left(r_datetime,10) = ? ";
     
    15661566    if ($month_flag) {
    15671567        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1568             $where .= " and substr(r_datetime::text,1,7) = ? ";
     1568            $where .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    15691569        } else {
    15701570            $where .= " and left(r_datetime, 7) = ? ";
     
    15731573    } else {
    15741574        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1575             $where .= " and substr(r_datetime::text,1,10) = ? ";
     1575            $where .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    15761576        } else {
    15771577            $where .= " and left(r_datetime,10) = ? ";
     
    16441644    if ($month_flag) {
    16451645        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1646             $where .= " and substr(r_datetime::text,1,7) = ? ";
     1646            $where .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    16471647        } else {
    16481648            $where .= " and left(r_datetime, 7) = ? ";
     
    16511651    } else {
    16521652        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1653             $where .= " and substr(r_datetime::text,1,10) = ? ";
     1653            $where .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    16541654        } else {
    16551655            $where .= " and left(r_datetime,10) = ? ";
     
    16851685    if ($month_flag) {
    16861686        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1687             $where .= " and substr(r_datetime::text,1,7) = ? ";
     1687            $where .= " and to_char(r_datetime, 'YYYY-MM') = ? ";
    16881688        } else {
    16891689            $where .= " and left(r_datetime, 7) = ? ";
     
    16921692    } else {
    16931693        if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {
    1694             $where .= " and substr(r_datetime::text,1,10) = ? ";
     1694            $where .= " and to_char(r_datetime, 'YYYY-MM-DD') = ? ";
    16951695        } else {
    16961696            $where .= " and left(r_datetime,10) = ? ";
Note: See TracChangeset for help on using the changeset viewer.