Changeset 23518


Ignore:
Timestamp:
2014/06/04 00:11:08 (7 years ago)
Author:
shutta
Message:

#2569 ダウンロード販売商品のダウンロード時にタイムアウト
DB件数に比例して、lfGetRealFileNameにて、無駄に同一データを大量にSELECTしてしまっていたのを修正。

Location:
branches/version-2_13-dev/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/Smarty/templates/default/mypage/history.tpl

    r23494 r23518  
    8383                    <!--{if $orderDetail.product_type_id == $smarty.const.PRODUCT_TYPE_DOWNLOAD}--> 
    8484                        <!--{if $orderDetail.is_downloadable}--> 
    85                             <a target="_self" href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/download.php?order_id=<!--{$tpl_arrOrderData.order_id}-->&product_id=<!--{$orderDetail.product_id}-->&product_class_id=<!--{$orderDetail.product_class_id}-->">ダウンロード</a> 
     85                            <a target="_self" href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/download.php?order_id=<!--{$tpl_arrOrderData.order_id}-->&product_class_id=<!--{$orderDetail.product_class_id}-->">ダウンロード</a> 
    8686                        <!--{else}--> 
    8787                            <!--{if $orderDetail.payment_date == "" && $orderDetail.effective == "0"}--> 
  • branches/version-2_13-dev/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php

    r23508 r23518  
    113113        $customer_id = $_SESSION['customer']['customer_id']; 
    114114        $order_id = $_GET['order_id']; 
    115         $product_id = $_GET['product_id']; 
    116115        $product_class_id = $_GET['product_class_id']; 
    117116 
    118117        //DBから商品情報の読込 
    119         $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id); 
     118        $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_class_id); 
    120119 
    121120        //ファイル情報が無い場合はNG 
     
    159158     * @param  integer $customer_id      会員ID 
    160159     * @param  integer $order_id         受注ID 
    161      * @param  integer $product_id       商品ID 
    162160     * @param  integer $product_class_id 商品規格ID 
    163161     * @return array   商品情報の配列 
    164162     */ 
    165     public function lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id) 
     163    public function lfGetRealFileName($customer_id, $order_id, $product_class_id) 
    166164    { 
    167165        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    168166        $col = <<< __EOS__ 
    169             pc.product_id AS product_id, 
    170             pc.product_class_id AS product_class_id, 
    171167            pc.down_realfilename AS down_realfilename, 
    172             pc.down_filename AS down_filename, 
    173             o.order_id AS order_id, 
    174             o.customer_id AS customer_id, 
    175             o.payment_date AS payment_date, 
    176             o.status AS status 
     168            pc.down_filename AS down_filename 
    177169__EOS__; 
    178170 
    179171        $table = <<< __EOS__ 
    180             dtb_products_class pc, 
    181             dtb_order_detail od, 
    182             dtb_order o 
     172            dtb_order AS o 
     173            JOIN dtb_order_detail AS od USING(order_id) 
     174            JOIN dtb_products_class AS pc USING(product_id, product_class_id) 
    183175__EOS__; 
    184176 
    185177        $dbFactory = SC_DB_DBFactory_Ex::getInstance(); 
    186         $where = 'o.customer_id = ? AND o.order_id = ? AND pc.product_id = ? AND pc.product_class_id = ?'; 
    187         $where .= ' AND od.product_id = ? AND od.product_class_id = ?'; 
     178        $where = 'o.customer_id = ? AND o.order_id = ? AND od.product_class_id = ?'; 
    188179        $where .= ' AND ' . $dbFactory->getDownloadableDaysWhereSql('o'); 
    189180        $where .= ' = 1'; 
    190         $arrRet = $objQuery->select($col, $table, $where, 
    191                                     array($customer_id, $order_id, $product_id, $product_class_id, $product_id, $product_class_id)); 
     181        $arrWhereVal = array($customer_id, $order_id, $product_class_id); 
     182        $arrRet = $objQuery->select($col, $table, $where, $arrWhereVal); 
    192183 
    193184        return $arrRet[0]; 
     
    199190        $objFormParam->addParam('customer_id', 'customer_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK')); 
    200191        $objFormParam->addParam('order_id', 'order_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK')); 
    201         $objFormParam->addParam('product_id', 'product_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK')); 
    202192        $objFormParam->addParam('product_class_id', 'product_class_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK')); 
    203193    } 
Note: See TracChangeset for help on using the changeset viewer.