Index: /branches/version-2_5-dev/html/install/sql/create_view.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/create_view.sql (revision 18819)
+++ /branches/version-2_5-dev/html/install/sql/create_view.sql (revision 18824)
@@ -102,23 +102,2 @@
ON T2.category_id = dtb_category.category_id
;
-CREATE VIEW vw_download_class as
- SELECT
- pc.product_id AS product_id,
- pc.classcategory_id1 AS classcategory_id1,
- pc.classcategory_id2 AS classcategory_id2,
- pc.down_realfilename AS down_realfilename,
- pc.down_filename AS down_filename,
- o.order_id AS order_id,
- o.customer_id AS customer_id,
- o.payment_date AS payment_date,
- o.status AS status
- FROM
- dtb_products_class pc,
- dtb_order_detail od,
- dtb_order o
- WHERE
- 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
-;
Index: /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql (revision 18820)
+++ /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql (revision 18824)
@@ -765,6 +765,5 @@
order_id int NOT NULL,
product_id int NOT NULL,
- classcategory_id1 int NOT NULL,
- classcategory_id2 int NOT NULL,
+ product_class_id int NOT NULL,
product_name text NOT NULL,
product_code text,
Index: /branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql (revision 18820)
+++ /branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql (revision 18824)
@@ -767,6 +767,5 @@
order_id int NOT NULL,
product_id int NOT NULL,
- classcategory_id1 int NOT NULL,
- classcategory_id2 int NOT NULL,
+ product_class_id int NOT NULL,
product_name text NOT NULL,
product_code text,
Index: /branches/version-2_5-dev/data/class/db/SC_DB_DBFactory.php
===================================================================
--- /branches/version-2_5-dev/data/class/db/SC_DB_DBFactory.php (revision 18820)
+++ /branches/version-2_5-dev/data/class/db/SC_DB_DBFactory.php (revision 18824)
@@ -125,8 +125,7 @@
* ダウンロード販売の検索条件の SQL を返す.
*
- * @param string $dtb_order_alias
* @return string 検索条件の SQL
*/
- function getDownloadableDaysWhereSql($dtb_order_alias) { return null; }
+ function getDownloadableDaysWhereSql() { return null; }
/**
Index: /branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php
===================================================================
--- /branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php (revision 18820)
+++ /branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php (revision 18824)
@@ -122,10 +122,10 @@
* @return string 検索条件の SQL
*/
- function getDownloadableDaysWhereSql($dtb_order_alias) {
+ function getDownloadableDaysWhereSql() {
$baseinfo = SC_Helper_DB_Ex::sf_getBasisData();
//downloadable_daysにNULLが入っている場合(無期限ダウンロード可能時)もあるので、NULLの場合は0日に補正
$downloadable_days = $baseinfo['downloadable_days'];
if($downloadable_days ==null || $downloadable_days == "")$downloadable_days=0;
- 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)";
+ 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)";
}
Index: /branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php
===================================================================
--- /branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php (revision 18820)
+++ /branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php (revision 18824)
@@ -142,6 +142,6 @@
* @return string 検索条件の SQL
*/
- function getDownloadableDaysWhereSql($dtb_order_alias) {
- 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))))";
+ function getDownloadableDaysWhereSql() {
+ 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))))";
}
@@ -415,28 +415,4 @@
)
__EOS__;
-
- $sql['vw_download_class'] = <<< __EOS__
- (SELECT
- pc.product_id AS product_id,
- pc.classcategory_id1 AS classcategory_id1,
- pc.classcategory_id2 AS classcategory_id2,
- pc.down_realfilename AS down_realfilename ,
- pc.down_filename AS down_filename,
- o.order_id AS order_id,
- o.customer_id AS customer_id,
- o.payment_date AS payment_date,
- o.status AS status
- FROM
- dtb_products_class pc,
- dtb_order_detail od,
- dtb_order o
- WHERE
- 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
- )
-__EOS__;
-
}
Index: /branches/version-2_5-dev/data/class/SC_Product.php
===================================================================
--- /branches/version-2_5-dev/data/class/SC_Product.php (revision 18821)
+++ /branches/version-2_5-dev/data/class/SC_Product.php (revision 18824)
@@ -257,11 +257,5 @@
$levels = array();
$parents = array();
- $i = 0;
foreach ($arrRet as $rows) {
- if($rows['level']==""){
- $rows['level']="1";
- $arrRet[$i]['level'] = $rows['level'];
-
- }
$levels[] = $rows['level'];
$parents[] = $rows['parent_class_combination_id'];
Index: /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php (revision 18820)
+++ /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php (revision 18824)
@@ -58,6 +58,5 @@
$order_id = $_GET['order_id'];
$product_id = $_GET['product_id'];
- $classcategory_id1 = $_GET['classcategory_id1'];
- $classcategory_id2 = $_GET['classcategory_id2'];
+ $product_class_id = $_GET['product_class_id'];
// ID の数値チェック
@@ -66,6 +65,5 @@
|| !is_numeric($order_id)
|| !is_numeric($product_id)
- || !is_numeric($classcategory_id1)
- || !is_numeric($classcategory_id2)) {
+ || !is_numeric($product_class_id)) {
SC_Utils_Ex::sfDispSiteError("");
}
@@ -79,5 +77,5 @@
//DBから商品情報の読込
- $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_id, $classcategory_id1, $classcategory_id2);
+ $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id);
//ステータスが支払済み以上である事
@@ -125,16 +123,32 @@
* @param integer $order_id 受注ID
* @param integer $product_id 商品ID
+ * @param integer $product_class_id 商品規格ID
* @return array 商品情報の配列
*/
- function lfGetRealFileName($customer_id, $order_id, $product_id, $classcategory_id1, $classcategory_id2) {
+ function lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id) {
$objQuery = new SC_Query();
- $col = "*";
- $table = "vw_download_class AS T1";
+ $col = <<< __EOS__
+ pc.product_id AS product_id,
+ pc.product_class_id AS product_class_id,
+ pc.down_realfilename AS down_realfilename,
+ pc.down_filename AS down_filename,
+ o.order_id AS order_id,
+ o.customer_id AS customer_id,
+ o.payment_date AS payment_date,
+ o.status AS status
+__EOS__;
+
+ $table = <<< __EOS__
+ dtb_products_class pc,
+ dtb_order_detail od,
+ dtb_order o
+__EOS__;
+
$dbFactory = SC_DB_DBFactory_Ex::getInstance();
- $where = "T1.customer_id = ? AND T1.order_id = ? AND T1.product_id = ? AND T1.classcategory_id1 = ? AND T1.classcategory_id2 = ?";
- $where .= " AND " . $dbFactory->getDownloadableDaysWhereSql("T1");
+ $where = "o.customer_id = ? AND o.order_id = ? AND pc.product_id = ? AND pc.product_class_id = ?";
+ $where .= " AND " . $dbFactory->getDownloadableDaysWhereSql();
$where .= " = 1";
$arrRet = $objQuery->select($col, $table, $where,
- array($customer_id, $order_id, $product_id, $classcategory_id1, $classcategory_id2));
+ array($customer_id, $order_id, $product_id, $product_class_id));
return $arrRet[0];
}
Index: /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php (revision 18820)
+++ /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php (revision 18824)
@@ -227,9 +227,9 @@
$col .= "od.classcategory_name2 AS classcategory_name2, od.price AS price, od.quantity AS quantity, od.point_rate AS point_rate";
$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";
- $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, ";
+ $col .= ",o.status AS status, pc.down AS down, o.payment_date AS payment_date, od.product_class_id as product_class_id, ";
$col .= $dbFactory->getDownloadableDaysWhereSql("o");
$col .= " AS effective";
- $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 = ?";
+ $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 = ?";
$arrRet = $objQuery->select($col, "dtb_products p, dtb_products_class pc, dtb_order_detail od, dtb_order o", $where);
return $arrRet;
Index: /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_HistoryDetail.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_HistoryDetail.php (revision 18701)
+++ /branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_HistoryDetail.php (revision 18824)
@@ -142,5 +142,5 @@
$col = "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate";
$where = "order_id = ?";
- $objQuery->setOrder("classcategory_id1, classcategory_id2");
+ $objQuery->setOrder("product_class_id");
$arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id));
return $arrRet;
Index: /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Complete.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Complete.php (revision 18820)
+++ /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Complete.php (revision 18824)
@@ -544,6 +544,7 @@
$sqlval['order_id'] = $order_id;
$sqlval['product_id'] = $arrCart[$i]['id'][0];
- $sqlval['classcategory_id1'] = $arrCart[$i]['id'][1];
- $sqlval['classcategory_id2'] = $arrCart[$i]['id'][2];
+ $sqlval['product_class_id'] = $arrCart[$i]['id'][1];
+ $sqlval['classcategory_id1'] = $arrCart[$i]['id'][2];
+ $sqlval['classcategory_id2'] = $arrCart[$i]['id'][3];
$sqlval['product_name'] = $arrData['name'];
$sqlval['product_code'] = $arrData['product_code'];
@@ -675,8 +676,8 @@
$objProduct = new SC_Product();
$productsClass = $objProduct->getProductsClassFullByProductId($arrID[0]);
-
+
foreach ($productsClass as $val) {
- if ($val['classcategory_id1'] == $arrID[1]
- && $val['classcategory_id2'] == $arrID[2]) {
+ if ($val['classcategory_id1'] == $arrID[2]
+ && $val['classcategory_id2'] == $arrID[3]) {
if (($val['stock_unlimited'] != '1' && $val['stock'] < $quantity) || $quantity == 0) {
Index: /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php (revision 18820)
+++ /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php (revision 18824)
@@ -145,16 +145,17 @@
$arrErr = $this->lfCheckError($product_id);
if (count($arrErr) == 0) {
+ $product_class_id = $this->arrForm['product_class_id'];
$classcategory_id1 = $this->arrForm['classcategory_id1'];
$classcategory_id2 = $this->arrForm['classcategory_id2'];
- // 規格1が設定されていない場合
+ // 規格1が設定されていない場合
if (!$this->tpl_classcat_find1[$product_id]) {
- $classcategory_id1 = '0';
- }
- // 規格2が設定されていない場合
+ $classcategory_id1 = '0';
+ }
+ // 規格2が設定されていない場合
if (!$this->tpl_classcat_find2[$product_id]) {
- $classcategory_id2 = '0';
- }
+ $classcategory_id2 = '0';
+ }
$objCartSess = new SC_CartSession();
- $objCartSess->addProduct(array($product_id, $classcategory_id1, $classcategory_id2), $this->arrForm['quantity']);
+ $objCartSess->addProduct(array($product_id, $product_class_id, $classcategory_id1, $classcategory_id2), $this->arrForm['quantity']);
$this->sendRedirect($this->getLocation(URL_CART_TOP));
exit;
@@ -163,4 +164,5 @@
$arrProduct =& $this->arrProducts[$key];
if ($arrProduct['product_id'] == $product_id) {
+ $arrProduct['product_class_id'] = $this->arrForm['product_class_id'];
$arrProduct['classcategory_id1'] = $this->arrForm['classcategory_id1'];
$arrProduct['classcategory_id2'] = $this->arrForm['classcategory_id2'];
Index: /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_Detail.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_Detail.php (revision 18820)
+++ /branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_Detail.php (revision 18824)
@@ -159,5 +159,5 @@
// 規格2クラス名
$this->tpl_class_name2 = $objProduct->className2[$product_id];
-
+
// 規格1
$this->arrClassCat1 = $objProduct->classCats1[$product_id];
@@ -181,5 +181,5 @@
if (!isset($_POST['mode'])) $_POST['mode'] = "";
$arrErr = array();
-
+
switch($_POST['mode']) {
case 'cart':
@@ -189,4 +189,5 @@
if (count($arrErr) == 0) {
$objCartSess = new SC_CartSession();
+ $product_class_id = $_POST['product_class_id'];
$classcategory_id1 = $_POST['classcategory_id1'];
$classcategory_id2 = $_POST['classcategory_id2'];
@@ -206,5 +207,5 @@
}
- $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity'));
+ $objCartSess->addProduct(array($_POST['product_id'], $product_class_id, $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity'));
if (!empty($_POST['gmo_oneclick'])) {
@@ -233,12 +234,12 @@
// サブタイトルを取得
$this->tpl_subtitle = $this->arrProduct['name'];
-
+
// 関連カテゴリを取得
$this->arrRelativeCat = $objDb->sfGetMultiCatTree($product_id);
-
+
// 画像ファイル指定がない場合の置換処理
$this->arrProduct['main_image']
= SC_Utils_Ex::sfNoImageMain($this->arrProduct['main_image']);
-
+
$this->lfSetFile();
// 支払方法の取得
@@ -296,5 +297,5 @@
// プロダクトIDの正当性チェック
$product_id = $this->lfCheckProductId();
-
+
$objView = new SC_MobileView();
$objCustomer = new SC_Customer();
@@ -398,4 +399,5 @@
if(count($this->arrErr) == 0) {
$objCartSess = new SC_CartSession();
+ $product_class_id = $_POST['product_class_id'];
$classcategory_id1 = $_POST['classcategory_id1'];
$classcategory_id2 = $_POST['classcategory_id2'];
@@ -411,5 +413,5 @@
}
- $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity'));
+ $objCartSess->addProduct(array($_POST['product_id'], $product_class_id, $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity'));
$this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true);
exit;
@@ -427,9 +429,9 @@
// サブタイトルを取得
$this->tpl_subtitle = $this->arrProduct["name"];
-
+
// 画像ファイル指定がない場合の置換処理
$this->arrProduct['main_image']
= SC_Utils_Ex::sfNoImageMain($this->arrProduct['main_image']);
-
+
// ファイル情報のセット
$this->lfSetFile();