Changeset 17144


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

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

Location:
branches/comu-ver2/data/class/pages
Files:
5 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); 
  • branches/comu-ver2/data/class/pages/admin/contents/LC_Page_Admin_Contents.php

    r16741 r17144  
    112112        //---- 編集データ取得 
    113113        if ($_POST["mode"] == "search" && is_numeric($_POST["news_id"])) { 
    114             $sql = "SELECT *, cast(substring(news_date,1, 10) as date) as cast_news_date FROM dtb_news WHERE news_id = ? "; 
     114            $sql = "SELECT *, cast(news_date as date) as cast_news_date FROM dtb_news WHERE news_id = ? "; 
    115115            $result = $conn->getAll($sql, array($_POST["news_id"])); 
    116116            foreach($result[0] as $key => $val ){ 
     
    168168 
    169169        //---- 全データ取得 
    170         $sql = "SELECT *, cast(substring(news_date,1, 10) as date) as cast_news_date FROM dtb_news WHERE del_flg = '0' ORDER BY rank DESC"; 
     170        $sql = "SELECT *, cast(news_date as date) as cast_news_date FROM dtb_news WHERE del_flg = '0' ORDER BY rank DESC"; 
    171171        $this->list_data = $conn->getAll($sql); 
    172172        $this->line_max = count($this->list_data); 
  • branches/comu-ver2/data/class/pages/admin/contents/LC_Page_Admin_Contents_Inquiry.php

    r16755 r17144  
    9898                              ); 
    9999 
    100         $sql = "SELECT *, cast(substring(create_date, 1, 10) as date) as disp_date FROM dtb_question WHERE del_flg = 0 ORDER BY question_id"; 
     100        $sql = "SELECT *, cast(create_date as date) as disp_date FROM dtb_question WHERE del_flg = 0 ORDER BY question_id"; 
    101101        $result = $conn->getAll($sql); 
    102102        $this->list_data = $result; 
  • branches/comu-ver2/data/class/pages/admin/mail/LC_Page_Admin_Mail_Template.php

    r16758 r17144  
    8787 
    8888 
    89         $sql = "SELECT *, (substring(create_date, 1, 19)) as disp_date FROM dtb_mailmaga_template WHERE del_flg = 0 ORDER BY create_date DESC"; 
     89        $sql = "SELECT *, create_date as disp_date FROM dtb_mailmaga_template WHERE del_flg = 0 ORDER BY create_date DESC"; 
    9090        $this->list_data = $conn->getAll($sql); 
     91        $this->list_data['disp_date'] = substr($this->list_data['disp_date'], 0, 19); 
    9192 
    9293        $objView->assignobj($this); 
  • branches/comu-ver2/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_News.php

    r16741 r17144  
    9898    function lfGetNews(){ 
    9999        $conn = new SC_DBConn(); 
    100         $sql = "SELECT *, cast(substring(news_date,1,10) as date) as news_date_disp FROM dtb_news WHERE del_flg = '0' ORDER BY rank DESC"; 
     100        $sql = "SELECT *, cast(news_date as date) as news_date_disp FROM dtb_news WHERE del_flg = '0' ORDER BY rank DESC"; 
    101101        $list_data = $conn->getAll($sql); 
    102102        return $list_data; 
Note: See TracChangeset for help on using the changeset viewer.