Ignore:
Timestamp:
2008/03/13 03:15:22 (16 years ago)
Author:
shutta
Message:

チケット #194 の修正。
(PostgreSQL 8.3 で、substring()で切り出すには、text型でないとエラーになる不具合の修正。)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/pages/admin/LC_Page_Admin_Home.php

    r16737 r17144  
    138138            }else if (DB_TYPE == "mysql") { 
    139139                $sql = "SELECT ".$method."(total) FROM dtb_order 
    140                          WHERE del_flg = 0 AND cast(substring(create_date,1, 10) as date) = DATE_ADD(current_date, interval -1 day) AND status <> " . ORDER_CANCEL; 
     140                         WHERE del_flg = 0 AND cast(create_date as date) = DATE_ADD(current_date, interval -1 day) AND status <> " . ORDER_CANCEL; 
    141141            } 
    142142            $return = $conn->getOne($sql); 
     
    182182        }else if (DB_TYPE == "mysql") { 
    183183            $sql = "SELECT COUNT(*) FROM dtb_review AS A LEFT JOIN dtb_products AS B ON A.product_id = B.product_id 
    184                      WHERE A.del_flg = 0 AND B.del_flg = 0 AND cast(substring(A.create_date,1, 10) as date) = DATE_ADD(current_date, interval -1 day) 
    185                      AND cast(substring(A.create_date,1, 10) as date) != cast(substring(now(),1, 10) as date)"; 
     184                     WHERE A.del_flg = 0 AND B.del_flg = 0 AND cast(A.create_date as date) = DATE_ADD(current_date, interval -1 day) 
     185                     AND cast(A.create_date as date) != current_date"; 
    186186        } 
    187187        $return = $conn->getOne($sql); 
Note: See TracChangeset for help on using the changeset viewer.