Changeset 16598


Ignore:
Timestamp:
2007/10/29 20:29:57 (16 years ago)
Author:
nanasess
Message:

デグレ修正

Location:
branches/feature-module-update/data/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/helper/SC_Helper_DB.php

    r16582 r16598  
    11491149        // 自身のランクを取得する 
    11501150        $rank = $objQuery->get($tableName, "rank", "$keyIdColumn = ?", array($keyId)); 
    1151         $max = $objQuery->max($tableName, "rank", $where, array($keyId)); 
     1151 
     1152        $max = $objQuery->max($tableName, "rank", $where); 
    11521153 
    11531154        // 値の調整(逆順) 
     
    11601161        } 
    11611162 
    1162         if( $position > $rank ) $term = "rank - 1"; //入れ替え先の順位が入れ換え元の順位より大きい場合 
    1163         if( $position < $rank ) $term = "rank + 1"; //入れ替え先の順位が入れ換え元の順位より小さい場合 
     1163        //入れ替え先の順位が入れ換え元の順位より大きい場合 
     1164        if( $position > $rank ) $term = "rank - 1"; 
     1165 
     1166        //入れ替え先の順位が入れ換え元の順位より小さい場合 
     1167        if( $position < $rank ) $term = "rank + 1"; 
     1168 
     1169        // XXX 入れ替え先の順位が入れ替え元の順位と同じ場合 
     1170        if (!isset($term)) $term = "rank"; 
    11641171 
    11651172        // 指定した順位の商品から移動させる商品までのrankを1つずらす 
  • branches/feature-module-update/data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php

    r16582 r16598  
    6969        // 通常時は親カテゴリを0に設定する。 
    7070        $this->arrForm['parent_category_id'] = 
    71             isset($_POST['parent_category_id']) ? $_POST['parent_category_id'] : ""; 
     71            isset($_POST['parent_category_id']) ? $_POST['parent_category_id'] : 0; 
    7272 
    7373        if (!isset($_POST['mode'])) $_POST['mode'] = ""; 
     
    8686            if(SC_Utils_Ex::sfIsInt($input_pos)) { 
    8787                $where = "category_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['parent_category_id']); 
    88                 $objDb->sfMoveRank("dtb_product_categories", "product_id", $_POST['product_id'], $input_pos, "category_id = ?"); 
     88                $objDb->sfMoveRank("dtb_product_categories", "product_id", $_POST['product_id'], $input_pos, $where); 
    8989            } 
    9090            break; 
     
    137137        $objQuery->setorder("rank DESC"); 
    138138 
    139         // viewも絞込みをかける(mysql用) 
    140         //sfViewWhere("&&noncls_where&&", $where, array($category_id), $objQuery->order . " " .  $objQuery->setlimitoffset(SEARCH_PMAX, $startno, true)); TODO 
    141  
    142139        $arrRet = $objQuery->select($col, $table, $where, array($category_id)); 
    143140        return $arrRet; 
Note: See TracChangeset for help on using the changeset viewer.