Ignore:
Timestamp:
2010/08/06 14:52:59 (10 years ago)
Author:
eccuore
Message:

#792(ダウンロード販売機能) 機能追加

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php

    r18701 r18777  
    222222    function lfGetOrderDetail($orderId) { 
    223223        $objQuery = new SC_Query(); 
    224         $col = "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate"; 
    225         $col .= ",CASE WHEN EXISTS(SELECT * FROM dtb_products WHERE product_id = dtb_order_detail.product_id AND del_flg = 0 AND status = 1) THEN '1' ELSE '0' END AS enable"; 
    226         $where = "order_id = ?"; 
     224        if (DB_TYPE == "mysql"){ 
     225            $col = "od.product_id AS product_id, od.product_code AS product_code, od.product_name AS product_name, od.classcategory_name1 AS classcategory_name1,"; 
     226            $col .= "od.classcategory_name2 AS classcategory_name2, od.price AS price, od.quantity AS quantity, od.point_rate AS point_rate"; 
     227            $col .= ",CASE WHEN EXISTS(SELECT * FROM dtb_products WHERE product_id = od.product_id AND del_flg = 0 AND status = 1) THEN '1' ELSE '0' END AS enable"; 
     228            $col .= ",o.status AS status, p.down AS down, (SELECT IF((SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1)=1, 1, DATE(NOW()),"; 
     229            $col .= "<= DATE(DATE_ADD(o.commit_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY)))) AS effective"; 
     230        }else{ 
     231            $baseinfo = SC_Helper_DB_Ex::sf_getBasisData(); 
     232            $col = "od.product_id AS product_id, od.product_code AS product_code, od.product_name AS product_name, od.classcategory_name1 AS classcategory_name1,"; 
     233            $col .= "od.classcategory_name2 AS classcategory_name2, od.price AS price, od.quantity AS quantity, od.point_rate AS point_rate"; 
     234            $col .= ",CASE WHEN EXISTS(SELECT * FROM dtb_products WHERE product_id = od.product_id AND del_flg = 0 AND status = 1) THEN '1' ELSE '0' END AS enable"; 
     235            $col .= ",o.status AS status, p.down AS down, (SELECT CASE WHEN (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 THEN 1 WHEN DATE(NOW())"; 
     236            $col .= "<= DATE(o.commit_date + '". $baseinfo['downloadable_days'] ." days') THEN 1 ELSE 0 END) AS effective"; 
     237        } 
     238        $where = "p.product_id = od.product_id AND od.order_id = o.order_id AND od.order_id = ?"; 
    227239        $objQuery->setOrder("classcategory_id1, classcategory_id2"); 
    228         $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($orderId)); 
     240        $arrRet = $objQuery->select($col, "dtb_products p, dtb_order_detail od, dtb_order o", $where, array($orderId)); 
    229241        return $arrRet; 
    230242    } 
Note: See TracChangeset for help on using the changeset viewer.