Ignore:
Timestamp:
2010/09/27 11:49:29 (16 years ago)
Author:
eccuore
Message:

#792(ダウンロード販売機能) vw_download_class削除、product_class_id対応(規格構成変更と並行作業中なので、作業途中の部分有)

Location:
branches/version-2_5-dev/data/class
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/SC_Product.php

    r18821 r18824  
    257257        $levels = array(); 
    258258        $parents = array(); 
    259         $i = 0; 
    260259        foreach ($arrRet as $rows) { 
    261             if($rows['level']==""){ 
    262                 $rows['level']="1"; 
    263                 $arrRet[$i]['level'] = $rows['level']; 
    264  
    265             } 
    266260            $levels[] = $rows['level']; 
    267261            $parents[] = $rows['parent_class_combination_id']; 
  • branches/version-2_5-dev/data/class/db/SC_DB_DBFactory.php

    r18820 r18824  
    125125     * ダウンロード販売の検索条件の SQL を返す. 
    126126     * 
    127      * @param string $dtb_order_alias 
    128127     * @return string 検索条件の SQL 
    129128     */ 
    130     function getDownloadableDaysWhereSql($dtb_order_alias) { return null; } 
     129    function getDownloadableDaysWhereSql() { return null; } 
    131130 
    132131    /** 
  • branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php

    r18820 r18824  
    142142     * @return string 検索条件の SQL 
    143143     */ 
    144     function getDownloadableDaysWhereSql($dtb_order_alias) { 
    145         return "(SELECT IF((SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1)=1, 1, DATE(NOW()) <= DATE(DATE_ADD(" . $dtb_order_alias . ".commit_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY))))"; 
     144    function getDownloadableDaysWhereSql() { 
     145        return "(SELECT IF((SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1)=1, 1, DATE(NOW()) <= DATE(DATE_ADD(o.payment_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY))))"; 
    146146    } 
    147147 
    … …  
    415415                ) 
    416416__EOS__; 
    417  
    418             $sql['vw_download_class'] = <<< __EOS__ 
    419                 (SELECT 
    420                     pc.product_id AS product_id, 
    421                     pc.classcategory_id1 AS classcategory_id1, 
    422                     pc.classcategory_id2 AS classcategory_id2, 
    423                     pc.down_realfilename AS down_realfilename , 
    424                     pc.down_filename AS down_filename, 
    425                     o.order_id AS order_id, 
    426                     o.customer_id AS customer_id, 
    427                     o.payment_date AS payment_date, 
    428                     o.status AS status 
    429                 FROM 
    430                     dtb_products_class pc, 
    431                     dtb_order_detail od, 
    432                     dtb_order o 
    433                 WHERE 
    434                     pc.product_id = od.product_id AND 
    435                     pc.classcategory_id1 = od.classcategory_id1 AND 
    436                     pc.classcategory_id2 = od.classcategory_id2 AND 
    437                     od.order_id = o.order_id 
    438                 ) 
    439 __EOS__; 
    440  
    441417        } 
    442418 
  • branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php

    r18820 r18824  
    122122     * @return string 検索条件の SQL 
    123123     */ 
    124     function getDownloadableDaysWhereSql($dtb_order_alias) { 
     124    function getDownloadableDaysWhereSql() { 
    125125        $baseinfo = SC_Helper_DB_Ex::sf_getBasisData(); 
    126126        //downloadable_daysにNULLが入っている場合(無期限ダウンロード可能時)もあるので、NULLの場合は0日に補正 
    127127        $downloadable_days = $baseinfo['downloadable_days']; 
    128128        if($downloadable_days ==null || $downloadable_days == "")$downloadable_days=0; 
    129         return "(SELECT CASE WHEN (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 AND " . $dtb_order_alias . ".payment_date IS NOT NULL THEN 1 WHEN DATE(NOW()) <= DATE(" . $dtb_order_alias . ".payment_date + '". $downloadable_days ." days') THEN 1 ELSE 0 END)"; 
     129        return "(SELECT CASE WHEN (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 AND o.payment_date IS NOT NULL THEN 1 WHEN DATE(NOW()) <= DATE(o.payment_date + '". $downloadable_days ." days') THEN 1 ELSE 0 END)"; 
    130130    } 
    131131 
  • branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php

    r18820 r18824  
    5858        $order_id = $_GET['order_id']; 
    5959        $product_id = $_GET['product_id']; 
    60         $classcategory_id1 = $_GET['classcategory_id1']; 
    61         $classcategory_id2 = $_GET['classcategory_id2']; 
     60        $product_class_id = $_GET['product_class_id']; 
    6261 
    6362        // ID の数値チェック 
    … …  
    6665            || !is_numeric($order_id) 
    6766            || !is_numeric($product_id) 
    68             || !is_numeric($classcategory_id1) 
    69             || !is_numeric($classcategory_id2)) { 
     67            || !is_numeric($product_class_id)) { 
    7068            SC_Utils_Ex::sfDispSiteError(""); 
    7169        } 
    … …  
    7977            //DBから商品情報の読込 
    8078 
    81             $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_id, $classcategory_id1, $classcategory_id2); 
     79            $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id); 
    8280 
    8381            //ステータスが支払済み以上である事 
    … …  
    125123     * @param integer $order_id 受注ID 
    126124     * @param integer $product_id 商品ID 
     125     * @param integer $product_class_id 商品規格ID 
    127126     * @return array 商品情報の配列 
    128127     */ 
    129     function lfGetRealFileName($customer_id, $order_id, $product_id, $classcategory_id1, $classcategory_id2) { 
     128    function lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id) { 
    130129        $objQuery = new SC_Query(); 
    131         $col = "*"; 
    132         $table = "vw_download_class AS T1"; 
     130        $col = <<< __EOS__ 
     131            pc.product_id AS product_id, 
     132            pc.product_class_id AS product_class_id, 
     133            pc.down_realfilename AS down_realfilename, 
     134            pc.down_filename AS down_filename, 
     135            o.order_id AS order_id, 
     136            o.customer_id AS customer_id, 
     137            o.payment_date AS payment_date, 
     138            o.status AS status 
     139__EOS__; 
     140 
     141        $table = <<< __EOS__ 
     142            dtb_products_class pc, 
     143            dtb_order_detail od, 
     144            dtb_order o 
     145__EOS__; 
     146 
    133147        $dbFactory = SC_DB_DBFactory_Ex::getInstance(); 
    134         $where = "T1.customer_id = ? AND T1.order_id = ? AND T1.product_id = ? AND T1.classcategory_id1 = ? AND T1.classcategory_id2 = ?"; 
    135         $where .= " AND " . $dbFactory->getDownloadableDaysWhereSql("T1"); 
     148        $where = "o.customer_id = ? AND o.order_id = ? AND pc.product_id = ? AND pc.product_class_id = ?"; 
     149        $where .= " AND " . $dbFactory->getDownloadableDaysWhereSql(); 
    136150        $where .= " = 1"; 
    137151        $arrRet = $objQuery->select($col, $table, $where, 
    138                                     array($customer_id, $order_id, $product_id, $classcategory_id1, $classcategory_id2)); 
     152                                    array($customer_id, $order_id, $product_id, $product_class_id)); 
    139153        return $arrRet[0]; 
    140154    } 
  • branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php

    r18820 r18824  
    227227        $col .= "od.classcategory_name2 AS classcategory_name2, od.price AS price, od.quantity AS quantity, od.point_rate AS point_rate"; 
    228228        $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"; 
    229         $col .= ",o.status AS status, pc.down AS down, o.payment_date AS payment_date, od.classcategory_id1 as classcategory_id1, od.classcategory_id2 as classcategory_id2, "; 
     229        $col .= ",o.status AS status, pc.down AS down, o.payment_date AS payment_date, od.product_class_id as product_class_id, "; 
    230230        $col .= $dbFactory->getDownloadableDaysWhereSql("o"); 
    231231        $col .= " AS effective"; 
    232232 
    233         $where = "p.product_id = od.product_id AND pc.product_id = od.product_id AND pc.classcategory_id1 = od.classcategory_id1 AND pc.classcategory_id2 = od.classcategory_id2 AND od.order_id = o.order_id AND od.order_id = ?"; 
     233        $where = "p.product_id = od.product_id AND pc.product_id = od.product_id AND pc.product_class_id = od.product_class_id AND od.order_id = o.order_id AND od.order_id = ?"; 
    234234        $arrRet = $objQuery->select($col, "dtb_products p, dtb_products_class pc, dtb_order_detail od, dtb_order o", $where); 
    235235        return $arrRet; 
  • branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_HistoryDetail.php

    r18701 r18824  
    142142        $col = "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate"; 
    143143        $where = "order_id = ?"; 
    144         $objQuery->setOrder("classcategory_id1, classcategory_id2"); 
     144        $objQuery->setOrder("product_class_id"); 
    145145        $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id)); 
    146146        return $arrRet; 
  • branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_Detail.php

    r18820 r18824  
    159159        // 規格2クラス名 
    160160        $this->tpl_class_name2 = $objProduct->className2[$product_id]; 
    161          
     161 
    162162        // 規格1 
    163163        $this->arrClassCat1 = $objProduct->classCats1[$product_id]; 
    … …  
    181181        if (!isset($_POST['mode'])) $_POST['mode'] = ""; 
    182182        $arrErr = array(); 
    183          
     183 
    184184        switch($_POST['mode']) { 
    185185            case 'cart': 
    … …  
    189189                if (count($arrErr) == 0) { 
    190190                    $objCartSess = new SC_CartSession(); 
     191                    $product_class_id = $_POST['product_class_id']; 
    191192                    $classcategory_id1 = $_POST['classcategory_id1']; 
    192193                    $classcategory_id2 = $_POST['classcategory_id2']; 
    … …  
    206207                    } 
    207208 
    208                     $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 
     209                    $objCartSess->addProduct(array($_POST['product_id'], $product_class_id, $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 
    209210 
    210211                    if (!empty($_POST['gmo_oneclick'])) { 
    … …  
    233234        // サブタイトルを取得 
    234235        $this->tpl_subtitle = $this->arrProduct['name']; 
    235          
     236 
    236237        // 関連カテゴリを取得 
    237238        $this->arrRelativeCat = $objDb->sfGetMultiCatTree($product_id); 
    238          
     239 
    239240        // 画像ファイル指定がない場合の置換処理 
    240241        $this->arrProduct['main_image'] 
    241242            = SC_Utils_Ex::sfNoImageMain($this->arrProduct['main_image']); 
    242          
     243 
    243244        $this->lfSetFile(); 
    244245        // 支払方法の取得 
    … …  
    296297        // プロダクトIDの正当性チェック 
    297298        $product_id = $this->lfCheckProductId(); 
    298          
     299 
    299300        $objView = new SC_MobileView(); 
    300301        $objCustomer = new SC_Customer(); 
    … …  
    398399            if(count($this->arrErr) == 0) { 
    399400                $objCartSess = new SC_CartSession(); 
     401                $product_class_id = $_POST['product_class_id']; 
    400402                $classcategory_id1 = $_POST['classcategory_id1']; 
    401403                $classcategory_id2 = $_POST['classcategory_id2']; 
    … …  
    411413                } 
    412414 
    413                 $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 
     415                $objCartSess->addProduct(array($_POST['product_id'], $product_class_id, $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 
    414416                $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true); 
    415417                exit; 
    … …  
    427429        // サブタイトルを取得 
    428430        $this->tpl_subtitle = $this->arrProduct["name"]; 
    429          
     431 
    430432        // 画像ファイル指定がない場合の置換処理 
    431433        $this->arrProduct['main_image'] 
    432434            = SC_Utils_Ex::sfNoImageMain($this->arrProduct['main_image']); 
    433          
     435 
    434436        // ファイル情報のセット 
    435437        $this->lfSetFile(); 
  • branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php

    r18820 r18824  
    145145            $arrErr = $this->lfCheckError($product_id); 
    146146            if (count($arrErr) == 0) { 
     147                $product_class_id = $this->arrForm['product_class_id']; 
    147148                $classcategory_id1 = $this->arrForm['classcategory_id1']; 
    148149                $classcategory_id2 = $this->arrForm['classcategory_id2']; 
    149                     // 規格1が設定されていない場合 
     150                // 規格1が設定されていない場合 
    150151                if (!$this->tpl_classcat_find1[$product_id]) { 
    151                         $classcategory_id1 = '0'; 
    152                     } 
    153                     // 規格2が設定されていない場合 
     152                    $classcategory_id1 = '0'; 
     153                } 
     154                // 規格2が設定されていない場合 
    154155                if (!$this->tpl_classcat_find2[$product_id]) { 
    155                         $classcategory_id2 = '0'; 
    156                     } 
     156                    $classcategory_id2 = '0'; 
     157                } 
    157158                $objCartSess = new SC_CartSession(); 
    158                 $objCartSess->addProduct(array($product_id, $classcategory_id1, $classcategory_id2), $this->arrForm['quantity']); 
     159                $objCartSess->addProduct(array($product_id, $product_class_id, $classcategory_id1, $classcategory_id2), $this->arrForm['quantity']); 
    159160                    $this->sendRedirect($this->getLocation(URL_CART_TOP)); 
    160161                    exit; 
    … …  
    163164                $arrProduct =& $this->arrProducts[$key]; 
    164165                if ($arrProduct['product_id'] == $product_id) { 
     166                    $arrProduct['product_class_id'] = $this->arrForm['product_class_id']; 
    165167                    $arrProduct['classcategory_id1'] = $this->arrForm['classcategory_id1']; 
    166168                    $arrProduct['classcategory_id2'] = $this->arrForm['classcategory_id2']; 
  • branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Complete.php

    r18820 r18824  
    544544                $sqlval['order_id'] = $order_id; 
    545545                $sqlval['product_id'] = $arrCart[$i]['id'][0]; 
    546                 $sqlval['classcategory_id1'] = $arrCart[$i]['id'][1]; 
    547                 $sqlval['classcategory_id2'] = $arrCart[$i]['id'][2]; 
     546                $sqlval['product_class_id'] = $arrCart[$i]['id'][1]; 
     547                $sqlval['classcategory_id1'] = $arrCart[$i]['id'][2]; 
     548                $sqlval['classcategory_id2'] = $arrCart[$i]['id'][3]; 
    548549                $sqlval['product_name'] = $arrData['name']; 
    549550                $sqlval['product_code'] = $arrData['product_code']; 
    … …  
    675676        $objProduct = new SC_Product(); 
    676677        $productsClass = $objProduct->getProductsClassFullByProductId($arrID[0]); 
    677      
     678 
    678679        foreach ($productsClass as $val) { 
    679             if ($val['classcategory_id1'] == $arrID[1] 
    680                 && $val['classcategory_id2'] == $arrID[2]) { 
     680            if ($val['classcategory_id1'] == $arrID[2] 
     681                && $val['classcategory_id2'] == $arrID[3]) { 
    681682 
    682683                if (($val['stock_unlimited'] != '1' && $val['stock'] < $quantity) || $quantity == 0) { 
Note: See TracChangeset for help on using the changeset viewer.