Changeset 16970
- Timestamp:
- 2008/01/10 13:35:00 (16 years ago)
- Location:
- branches/feature-module-update
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/helper/SC_Helper_DB.php
r16741 r16970 761 761 array($category_id)); 762 762 763 $max = 0;763 $max = "0"; 764 764 foreach ($arrCat as $val) { 765 765 // 同一商品が存在する場合は登録しない … … 768 768 } 769 769 // 最上位ランクを取得 770 $max = ($max >$val["rank"]) ? $val["rank"] : $max;771 } 772 $sqlval["rank"] = $max ;770 $max = ($max < $val["rank"]) ? $val["rank"] : $max; 771 } 772 $sqlval["rank"] = $max + 1; 773 773 $objQuery->insert("dtb_product_categories", $sqlval); 774 774 } … … 1096 1096 // ランク入れ替えの実行 1097 1097 $sqlup = "UPDATE $table SET rank = ? WHERE $colname = ?"; 1098 if($andwhere != "") { 1099 $sqlup.= " AND $andwhere"; 1100 } 1098 1101 $objQuery->exec($sqlup, array($rank + 1, $id)); 1099 1102 $objQuery->exec($sqlup, array($rank, $up_id)); … … 1132 1135 // ランク入れ替えの実行 1133 1136 $sqlup = "UPDATE $table SET rank = ? WHERE $colname = ?"; 1137 if($andwhere != "") { 1138 $sqlup.= " AND $andwhere"; 1139 } 1134 1140 $objQuery->exec($sqlup, array($rank - 1, $id)); 1135 1141 $objQuery->exec($sqlup, array($rank, $down_id)); -
branches/feature-module-update/html/install/sql/insert_data.sql
r16952 r16970 358 358 359 359 INSERT INTO dtb_product_categories (product_id,category_id,rank) VALUES (1,5,1); 360 INSERT INTO dtb_product_categories (product_id,category_id,rank) VALUES (2,4, 2);360 INSERT INTO dtb_product_categories (product_id,category_id,rank) VALUES (2,4,1); 361 361 362 362 INSERT INTO dtb_category_count VALUES (4, 1, now());
Note: See TracChangeset
for help on using the changeset viewer.