- Timestamp:
- 2012/02/06 21:27:04 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_DB.php
r21441 r21444 1073 1073 1074 1074 //入れ替え先の順位が入れ換え元の順位より大きい場合 1075 if( $position > $rank 1075 if( $position > $rank) $term = "rank - 1"; 1076 1076 1077 1077 //入れ替え先の順位が入れ換え元の順位より小さい場合 1078 if( $position < $rank 1078 if( $position < $rank) $term = "rank + 1"; 1079 1079 1080 1080 // XXX 入れ替え先の順位が入れ替え元の順位と同じ場合 … … 1087 1087 } 1088 1088 1089 if( $position > $rank ) $objQuery->exec( $sql, array( $rank + 1, $position 1090 if( $position < $rank ) $objQuery->exec( $sql, array( $position, $rank - 1 1089 if( $position > $rank ) $objQuery->exec( $sql, array( $rank + 1, $position)); 1090 if( $position < $rank ) $objQuery->exec( $sql, array( $position, $rank - 1)); 1091 1091 1092 1092 // 指定した順位へrankを書き換える。 … … 1096 1096 } 1097 1097 1098 $objQuery->exec( $sql, array( $position, $keyId ) 1098 $objQuery->exec( $sql, array( $position, $keyId )); 1099 1099 $objQuery->commit(); 1100 1100 } … … 1154 1154 * @return array 特定のカラムの配列 1155 1155 */ 1156 function sfGetParentsCol($objQuery, $table, $id_name, $col_name, $arrId 1156 function sfGetParentsCol($objQuery, $table, $id_name, $col_name, $arrId) { 1157 1157 $col = $col_name; 1158 1158 $len = count($arrId);
Note: See TracChangeset
for help on using the changeset viewer.